* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--app-font-family);
}

body {
    background: #020617;
    color: #ffffff;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 120px 24px 24px;
}

/* BRAND */
.brand {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);

    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: min(100%, 320px);
}

.brand-logo-shell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-compact-logo-img,
.brand-wordmark {
    display: none;
}

.brand-full-logo-img {
    width: min(220px, 52vw);
    max-width: 100%;
    height: auto;
    display: block;
}

.brand-texts {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* PANEL */
.login-panel-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 450px;

    padding: 30px;
    border-radius: 28px;

    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);

    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.30);
    overflow: hidden;
}

.login-card-header,
.login-card-body,
.login-card-footer {
    position: relative;
    z-index: 1;
}

.login-card-header h1 {
    margin: 0 0 10px;
    font-size: 2rem;
    line-height: 1.1;
}

.login-card-header p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.7;
    font-size: 0.98rem;
}

/* BODY */
.login-card-body {
    margin-top: 28px;
}

.google-btn {
    width: 100%;
    min-height: 58px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    cursor: pointer;

    background: var(--app-primary-bg);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;

    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.20);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.google-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.google-btn.loading {
    opacity: 0.86;
    pointer-events: none;
}

.google-icon {
    width: 22px;
    height: 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    border-radius: 50%;
    flex-shrink: 0;
}

.google-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.signup-btn {
    width: 100%;
    min-height: 64px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(103, 232, 249, 0.18);
    background: rgba(8, 47, 73, 0.86);
    color: #e0f2fe;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 14px 28px rgba(8, 47, 73, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.signup-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(103, 232, 249, 0.34);
    background: rgba(8, 47, 73, 0.96);
}

.login-divider {
    margin: 24px 0;
    position: relative;
    text-align: center;
}

.login-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-50%);
}

.login-divider span {
    position: relative;
    display: inline-block;
    padding: 0 12px;
    background: rgba(15, 23, 42, 0.86);
    color: #94a3b8;
    font-size: 0.82rem;
}

.login-info-box {
    padding: 18px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.info-row + .info-row {
    margin-top: 12px;
}

.info-label {
    color: #94a3b8;
    font-size: 0.92rem;
}

.info-value {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
}

.info-value.success {
    color: #86efac;
}

.info-value.pending {
    color: #fcd34d;
}

/* FOOTER */
.login-card-footer {
    margin-top: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #7dd3fc;
    font-weight: 700;
    font-size: 0.92rem;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.85;
}


/* LOGIN */
#local-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

#local-login-form input {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(15,23,42,0.86);
    color: #fff;
    font-size: 1rem;
}

.local-login-btn {
    padding: 14px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    background: var(--app-primary-bg);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.local-login-btn:hover {
    transform: translateY(-1px);
}

.secondary-action-btn {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    background: rgba(14, 116, 144, 0.14);
    color: #bae6fd;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.secondary-action-btn:hover {
    transform: translateY(-1px);
    background: rgba(14, 116, 144, 0.22);
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.modal-content {
    position: relative;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 22px;
    padding: 34px;
    max-width: 440px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

.modal-header {
    display: grid;
    gap: 10px;
    padding-right: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.modal-header p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.6;
}

.register-form {
    display: grid;
    gap: 14px;
}

#register-form input {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(2, 6, 23, 0.78);
    color: #fff;
    font-size: 1rem;
}

#register-form .local-login-btn {
    background: var(--app-primary-bg);
    margin-top: 4px;
}

.modal-feedback {
    color: #fcd34d;
    font-size: 0.9rem;
    min-height: 1.2em;
    margin: 0;
}

.modal-actions-stack {
    display: grid;
    gap: 12px;
}


/* RESPONSIVE */
@media (max-width: 640px) {
    .login-page {
        justify-content: flex-start;
        gap: 30px;
        padding: 28px 16px 16px;
    }

    .brand {
        position: static;
        left: auto;
        transform: none;
        width: 100%;
    }

    .brand-logo-shell {
        justify-content: center;
        gap: 14px;
    }

    .brand-full-logo-img {
        display: none;
    }

    .brand-compact-logo-img {
        display: block;
        width: 56px;
        height: 56px;
        flex: 0 0 auto;
    }

    .brand-wordmark {
        display: inline-block;
        font-size: 2rem;
        font-weight: 800;
        letter-spacing: 0.02em;
    }

    .login-card {
        max-width: 420px;
        margin-top: 4px;
        padding: 18px;
        border-radius: 22px;
    }

    .login-panel-wrap {
        margin-top: 8px;
    }

    .login-card-header h1 {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }

    .login-card-header p {
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .login-card-body {
        margin-top: 18px;
    }

    #local-login-form {
        gap: 12px;
        margin-bottom: 18px;
    }

    #local-login-form input,
    .local-login-btn,
    .google-btn,
    .signup-btn {
        min-height: 48px;
        padding: 12px 14px;
        border-radius: 14px;
    }

    .google-btn,
    .signup-btn {
        gap: 10px;
        font-size: 0.95rem;
        box-shadow: none;
    }

    .login-divider {
        margin: 16px 0;
    }

    .login-divider span {
        font-size: 0.78rem;
    }

    .login-divider-status {
        display: none;
    }

    .login-info-box {
        padding: 0;
        background: transparent;
        border: none;
    }

    .login-info-box[data-login-status-state="ready"] {
        display: none;
    }

    .info-row {
        justify-content: flex-start;
        gap: 8px;
    }

    .info-label {
        display: none;
    }

    .info-value {
        font-size: 0.88rem;
    }

    .login-card-footer {
        margin-top: 18px;
    }


    .modal-content {
        padding: 26px 22px;
    }

    .modal-close {
        top: 14px;
        right: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.06);
        font-size: 1.12rem;
        line-height: 1;
        text-align: center;
        aspect-ratio: 1 / 1;
    }
}