/* File: styles/auth/login.css */

/* ==========================================================================
   Layout & Containers
   ========================================================================== */
.main-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 64px;
    width: 100%;
    padding: 0 64px;
    margin: 0 0 64px;
    box-sizing: border-box;
}

.logo-container {
    position: relative;
    width: 100%;
    height: 72px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
}

.form-container {
    max-width: 500px;
    width: 100%;
}

.main-subcontainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
}

.fields-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.forgot-password-container {
    width: 100%;
    text-align: end;
}

/* ==========================================================================
   Branding & Logo
   ========================================================================== */
.logo {
    width: 180px;
    height: auto;
}

.logo-link {
    display: flex;
    align-items: center;
}

/* ==========================================================================
   Typography
   ========================================================================== */
.heading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

h2 {
    margin: 0;
    font-family: var(--_typography---font-styles--heading);
    font-weight: 400;
    font-size: 48px;
    line-height: 120%;
    text-align: center;
    color: var(--_primitives---colors--corvette-dark);
}

.paragraph-login-page {
    margin: 0;
    font-family: var(--_typography---font-styles--body);
    font-weight: 400;
    font-size: 18px;
    line-height: 160%;
    text-align: center;
    color: var(--_primitives---colors--white);
}

.field-label,
.error-message,
.account-text {
    margin: 0;
    font-family: var(--_typography---font-styles--body);
    font-weight: 400;
    line-height: 160%;
    color: var(--_primitives---colors--white);
}

.field-label {
    font-size: 16px;
}

.error-message {
    text-align: center;
    margin-bottom: 15px;
    color: var(--_primitives---colors--sweet-pink);
}

.account-text {
    font-size: 16px;
    text-align: center;
}

/* ==========================================================================
   Form Inputs & Validation
   ========================================================================== */
.input-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-container input {
    box-sizing: border-box;
    width: 100%;
    height: 58px;
    padding: 16px;
    border: 1px solid var(--_primitives---colors--masala);
    border-radius: 8px;
    background-color: transparent;
    color: var(--_primitives---colors--white);
    font-family: var(--_typography---font-styles--body);
    transition: all 0.3s;
    appearance: none;
    outline: none;
    font-size: 16px;
}

.input-container input:focus {
    border-color: var(--_primitives---colors--sinbad);
}

.input-container input::placeholder {
    font-family: var(--_typography---font-styles--body);
    font-weight: 300;
    font-size: 16px;
    line-height: 160%;
    color: var(--_primitives---colors--neutral-light);
}

.input-container input:focus::placeholder {
    color: transparent;
}

#caps-lock-status {
    display: none;
    width: 100%;
    padding: 5px 0;
    margin-top: 5px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--_primitives---colors--sweet-pink);
    background-color: var(--_primitives---colors--white);
    border-radius: 5px;
}

.toggle-password {
    position: absolute;
    top: calc(50% - 10px);
    right: 10px;
    width: 24px;
    display: block;
    cursor: pointer;
}

.forgot-password-link {
    font-family: var(--_typography---font-styles--body);
    font-weight: 400;
    font-size: 14px;
    line-height: 160%;
    color: var(--_primitives---colors--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   Buttons & Links
   ========================================================================== */
button {
    width: 100%;
    height: 48px;
    padding: 16px 32px;
    background: var(--_primitives---colors--sinbad);
    color: var(--_primitives---colors--neutral-darkest);
    font-family: var(--_typography---font-styles--body);
    font-weight: 500;
    font-size: 16px;
    line-height: 100%;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    outline: none;
}

button:hover {
    background: var(--_primitives---colors--sinbad-dark);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.open-account-link {
    font-family: var(--_typography---font-styles--body);
    font-weight: 500;
    font-size: 16px;
    line-height: 160%;
    color: var(--_primitives---colors--sinbad);
    text-decoration: none;
    transition: all 0.3s ease;
}

.open-account-link:hover {
    color: var(--_primitives---colors--sinbad-dark);
}

.lang-dd {
    position: relative;
    display: inline-flex;
    justify-content: center;
    width: 100%;
}

.lang-dd-trigger {
    width: auto;
    height: auto;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--_primitives---colors--masala-dark);
    background: transparent;
    color: var(--_primitives---opacity--white-60);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--_typography---font-styles--body);
    font-weight: 400;
    font-size: 14px;
    line-height: 160%;
    transition: all 0.3s ease;
}

.lang-dd-trigger:hover {
    background: rgba(255,255,255,0.06);
}

.lang-dd-globe,
.lang-dd-globe svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-dd-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 8px);
    width: auto;
    background-color: var(--_primitives---colors--neutral-darker);
    border: 1px solid var(--_primitives---colors--masala);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0,0,0,.45);
    padding: 8px;
    z-index: 50;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.lang-dd.open .lang-dd-menu {
    display: flex;
}

.lang-dd-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--_primitives---colors--white);
    font-family: var(--_typography---font-styles--body);
    font-weight: 500;
    font-size: 14px;
    line-height: 160%;
    transition: all 0.3s ease;
    width: auto;
}

.lang-dd-item:hover {
    background: rgba(255,255,255,0.06);
}

.lang-dd-item.active {
    color: var(--_primitives---colors--sinbad);
    background: rgba(79, 207, 214, 0.10);
}

.lang-dd-tick {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
}

.lang-dd-text {
    flex: 0 0 auto;
}

/* ==========================================================================
   Modal / Popup Overlay
   ========================================================================== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #14121180;
    backdrop-filter: blur(10px);
    z-index: 9998;
}

.popup-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    padding: 32px 24px;
    background-color: var(--_primitives---colors--neutral-darker);
    border: 1px solid var(--_primitives---colors--masala);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.45);
    z-index: 9999;
}

/* Existing close button (used by the unverified popup) */
.popup-message .close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    line-height: 24px;
    cursor: pointer;
    color: var(--_primitives---colors--white);
    transition: color 0.3s ease;
}

.popup-message .close-btn:hover {
    color: var(--_primitives---colors--sinbad);
}

/* ==========================================================================
   Accounts-style close icon (reused by 2FA popup)
   ========================================================================== */
.credentials-popup-close-button {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.credentials-popup-close-button:hover {
    transform: scale(1.1);
}

.credentials-popup-close-button img {
    width: 75%;
    height: 75%;
    display: block;
}

/* 2FA close icon positioned like the old × (doesn't affect layout) */
.twofa-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* ==========================================================================
   Popup body text
   ========================================================================== */
.popup-message p {
    margin: 0;
    padding-right: 24px;
    font-family: var(--_typography---font-styles--body);
    font-weight: 300;
    font-size: 16px;
    line-height: 160%;
    text-align: center;
    color: var(--_primitives---colors--white);
}

@media screen and (max-width: 480px) {
    .popup-message {
        padding: 24px 20px;
    }

    .popup-message p {
        font-size: 14px;
    }
}

/* ==========================================================================
   2FA Popup Additions
   ========================================================================== */
.twofa-title {
    margin: 0 0 10px 0;
    font-weight: 400;
    font-size: 25px;
    line-height: 140%;
    text-align: center;
    color: var(--_primitives---colors--white);
    font-family: var(--_typography---font-styles--heading);
}

.twofa-prompt {
    margin: 0 0 6px 0;
    font-family: var(--_typography---font-styles--body);
    font-weight: 500;
    font-size: 16px;
    line-height: 160%;
    text-align: center;
    color: var(--_primitives---colors--white);
}

.twofa-subtext {
    margin: 0 0 14px 0;
    padding-right: 24px;
    font-family: var(--_typography---font-styles--body);
    font-weight: 300;
    font-size: 13px;
    line-height: 160%;
    text-align: center;
    color: var(--_primitives---colors--white);
    opacity: 0.9;
}

.twofa-error {
    margin: 0 0 12px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 68, 88, 0.12);
    border: 1px solid rgba(255, 68, 88, 0.35);
    font-family: var(--_typography---font-styles--body);
    font-size: 14px;
    line-height: 160%;
    color: var(--_primitives---colors--sweet-pink);
    text-align: center;
}

.twofa-code-boxes {
    width: 100%;
    margin-top: 6px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.twofa-digit {
    box-sizing: border-box;
    width: 44px;
    height: 58px;
    border: 1px solid var(--_primitives---colors--masala);
    border-radius: 10px;
    background-color: transparent;
    color: var(--_primitives---colors--white);
    font-family: var(--_typography---font-styles--body);
    font-size: 20px;
    text-align: center;
    outline: none;
    appearance: none;
}

.twofa-digit:focus {
    border-color: var(--_primitives---colors--sinbad);
}

.twofa-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.twofa-btn {
    position: relative;
}

.twofa-btn-secondary {
    background: transparent;
    border: 1px solid var(--_primitives---colors--masala);
    color: var(--_primitives---colors--white);
}

.twofa-btn-secondary:hover {
    background: rgba(255,255,255,0.06);
}

.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: rgba(255,255,255,0.95);
    border-radius: 50%;
    margin-left: 10px;
    vertical-align: middle;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.twofa-resend-hint {
    margin-top: 2px;
    font-family: var(--_typography---font-styles--body);
    font-weight: 300;
    font-size: 13px;
    line-height: 160%;
    text-align: center;
    color: var(--_primitives---colors--white);
    opacity: 0.85;
}

.twofa-footer {
    margin-top: 12px;
    text-align: center;
}

.twofa-cancel-link {
    font-family: var(--_typography---font-styles--body);
    font-weight: 400;
    font-size: 14px;
    line-height: 160%;
    color: var(--_primitives---colors--sinbad);
    text-decoration: none;
}

.twofa-cancel-link:hover {
    color: var(--_primitives---colors--sinbad-dark);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media screen and (max-width: 992px) {
    .main-content-wrapper {
        padding: 0 40px;
        gap: 48px;
    }

    .form-container {
        width: 100%;
        max-width: 500px;
    }
}

@media screen and (max-width: 768px) {
    .main-content-wrapper {
        padding: 0 32px;
        gap: 40px;
        margin: 0 0 48px;
    }

    .heading-container h2 {
        font-size: 32px;
    }

    .paragraph-login-page {
        font-size: 16px;
    }
}

@media screen and (max-width: 576px) {
    .main-content-wrapper {
        padding: 0 24px;
        gap: 32px;
        margin: 0 0 32px;
    }

    .logo {
        width: 140px;
    }

    .heading-container h2 {
        font-size: 28px;
    }

    .paragraph-login-page {
        font-size: 14px;
    }

    .input-container input {
        height: 50px;
        font-size: 16px;
        padding: 12px 16px;
    }

    .input-container input::placeholder {
        font-size: 13px;
    }

    .field-label {
        font-size: 14px;
    }

    button {
        height: 44px;
        padding: 12px 24px;
        font-size: 15px;
    }

    .account-text {
        font-size: 14px;
    }

    .twofa-digit {
        height: 52px;
        width: 40px;
        font-size: 19px;
    }

    .twofa-code-boxes {
        gap: 8px;
    }
}

@media screen and (max-width: 375px) {
    .main-content-wrapper {
        padding: 0 16px;
        gap: 24px;
    }

    .logo {
        width: 120px;
    }

    .heading-container h2 {
        font-size: 24px;
    }

    .input-container input {
        height: 46px;
        font-size: 15px;
        padding: 10px 14px;
    }

    .toggle-password {
        width: 20px;
    }

    button {
        height: 42px;
        padding: 10px 20px;
        font-size: 14px;
    }

    .forgot-password-link, .open-account-link {
        font-size: 13px;
    }

    .twofa-digit {
        height: 48px;
        width: 36px;
        font-size: 18px;
        border-radius: 9px;
    }

    .twofa-code-boxes {
        gap: 7px;
    }
}
