/* ===== AUTHENTICATION SHARED STYLES ===== */

body.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top left, #eff6ff 0%, #f9fafb 50%, #eff6ff 100%);
    padding: 40px 20px;
}

body.auth-page {
    overflow-x: hidden;
}

/* Header / Branding */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--blue);
    border-radius: 12px;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

/* Auth Card */
.auth-card {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    margin-bottom: 32px;
    position: relative;
}

.card-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--gray-400);
    transition: color 0.2s;
}

.card-close-btn:hover {
    color: var(--gray-700);
}

.auth-card-header {
    margin-bottom: 28px;
}

.auth-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.auth-card-desc {
    font-size: 13px;
    color: var(--gray-500);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-400);
    display: flex;
    pointer-events: none;
}

.input-icon-right {
    position: absolute;
    right: 14px;
    color: var(--gray-400);
    display: flex;
    cursor: pointer;
    transition: color 0.2s;
}

.input-icon-right:hover {
    color: var(--gray-600);
}

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    color: var(--gray-900);
    transition: all 0.2s;
    min-width: 0;
}

@supports (-webkit-touch-callout: none) {
    .form-input {
        font-size: 16px;
    }
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:focus {
    outline: none;
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 4px var(--blue-pale);
}

.form-input.has-right-icon {
    padding-right: 42px;
}

.form-input.no-left-icon {
    padding-left: 14px;
}

/* Verification Code Group */
.verify-group {
    display: flex;
    gap: 12px;
    min-width: 0;
}

.verify-group .input-wrapper {
    flex: 1;
    min-width: 0;
}

.btn-verify {
    height: 46px;
    padding: 0 16px;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-verify:hover {
    background: #dbeafe;
}

.btn-verify:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
    margin-bottom: 24px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.auth-checkbox input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
    accent-color: var(--blue);
    cursor: pointer;
}

.forgot-link {
    font-size: 13px;
    color: var(--blue);
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.link-blue {
    color: var(--blue);
}

.link-blue:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    height: 46px;
    background: var(--blue);
    color: white;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--gray-400);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider::before {
    margin-right: 16px;
}

.divider::after {
    margin-left: 16px;
}

.btn-google {
    width: 100%;
    height: 46px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-google:hover {
    background: var(--gray-50);
}

.google-signin-wrap {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--gray-600);
    word-break: break-word;
}

.auth-switch a {
    color: var(--blue);
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Footer / Features */
.auth-features {
    display: flex;
    gap: 32px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    min-width: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    word-break: break-word;
}

.copy-footer {
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    margin-top: 24px;
}

.back-home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 24px;
    transition: color 0.2s;
}

.back-home:hover {
    color: var(--gray-600);
}

/* Special header layout for register */
.top-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 32px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.top-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--blue);
    color: white;
    border-radius: 8px;
}

.top-close {
    color: var(--gray-500);
    transition: color 0.2s;
}

.top-close:hover {
    color: var(--gray-800);
}

@media (max-width: 640px) {
    body.auth-page {
        padding: 24px 16px;
        background: white;
    }

    .auth-card {
        padding: 32px 24px;
        box-shadow: none;
        border: none;
        margin-bottom: 16px;
    }

    .top-nav {
        padding: 24px 16px;
        position: static;
        margin-bottom: 24px;
    }

    .auth-features {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 430px) {
    body.auth-page {
        min-height: 100dvh;
        justify-content: flex-start;
        padding: 8px 12px 12px;
    }

    .auth-header {
        margin-bottom: 14px;
    }

    .auth-logo-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 10px;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .auth-card {
        max-width: 100%;
        border-radius: 12px;
        padding: 16px 14px;
        margin-bottom: 10px;
    }

    .auth-card-title {
        font-size: 18px;
    }

    .auth-card-desc {
        font-size: 12px;
        line-height: 1.35;
    }

    .auth-card-header {
        margin-bottom: 14px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-label {
        margin-bottom: 6px;
        font-size: 12px;
    }

    .form-input,
    .btn-submit,
    .btn-google,
    .btn-verify {
        height: 40px;
    }

    .form-input {
        font-size: 13px;
        padding-left: 38px;
    }

    .form-input.has-right-icon {
        padding-right: 38px;
    }

    @supports (-webkit-touch-callout: none) {
        .form-input {
            font-size: 16px;
        }
    }

    .input-icon {
        left: 12px;
    }

    .input-icon-right {
        right: 12px;
    }

    .divider {
        margin: 14px 0;
        font-size: 11px;
    }

    .verify-group {
        gap: 8px;
    }

    .btn-verify {
        padding: 0 12px;
        flex: 0 0 auto;
    }

    .form-actions {
        gap: 6px;
        margin-top: 0;
        margin-bottom: 12px;
    }

    .auth-checkbox,
    .forgot-link,
    .auth-switch {
        font-size: 12px;
        line-height: 1.35;
    }

    .auth-checkbox {
        align-items: flex-start;
    }

    .auth-checkbox span {
        line-height: 1.45;
        word-break: break-word;
    }

    .auth-features {
        display: none;
    }

    .top-nav {
        padding: 14px 12px;
        margin-bottom: 10px;
    }

    .top-logo {
        font-size: 15px;
        gap: 8px;
    }

    .top-logo-icon {
        width: 28px;
        height: 28px;
    }

    .navbar {
        width: 100%;
        padding: 4px 0;
    }

    .navbar-inner {
        padding: 0 4px;
        row-gap: 4px;
    }

    .navbar-logo {
        width: auto;
        font-size: 13px;
        justify-content: flex-start;
    }

    .logo-icon svg {
        width: 18px;
        height: 18px;
    }

    .logo-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 210px;
    }

    .navbar-nav,
    .copy-footer {
        display: none;
    }

    .back-home {
        display: flex;
        margin-top: 10px;
        font-size: 12px;
    }

    .navbar-actions {
        gap: 4px;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
    }

    .auth-card[style] {
        margin-top: 4px !important;
    }

    .auth-card-header[style] {
        margin-bottom: 14px;
    }

    .form-actions[style] {
        margin-top: 4px !important;
    }

    .btn-submit[style] {
        margin-top: 12px !important;
    }

    .auth-switch[style] {
        margin-top: 12px !important;
    }

    .login-back-home {
        margin-top: 8px;
    }
}

@media (max-width: 390px) {
    body.auth-page {
        padding: 6px 10px 10px;
    }

    .auth-card {
        padding: 14px 12px;
    }

    .form-input,
    .btn-submit,
    .btn-google,
    .btn-verify {
        height: 38px;
    }

    .form-input {
        font-size: 13px;
    }

    .form-label,
    .auth-checkbox,
    .auth-switch {
        font-size: 12.5px;
    }
}

@media (max-width: 375px) {
    .auth-title {
        font-size: 18px;
    }

    .auth-card-title {
        font-size: 16px;
    }

    .btn-submit {
        font-size: 14px;
    }

    .top-logo {
        font-size: 14px;
    }

    .logo-text {
        max-width: 180px;
    }
}

/* ===== DARK MODE ===== */
[data-theme='dark'] body.auth-page {
    background: radial-gradient(circle at top left, #172338 0%, #0b1220 60%, #111a2b 100%);
}

[data-theme='dark'] .auth-card,
[data-theme='dark'] .btn-google,
[data-theme='dark'] .form-input,
[data-theme='dark'] .divider::before,
[data-theme='dark'] .divider::after {
    background: #121b2d;
    border-color: #273248;
}

[data-theme='dark'] .auth-title,
[data-theme='dark'] .auth-card-title,
[data-theme='dark'] .form-label,
[data-theme='dark'] .top-logo {
    color: #f1f5ff;
}

[data-theme='dark'] .auth-subtitle,
[data-theme='dark'] .auth-card-desc,
[data-theme='dark'] .auth-checkbox,
[data-theme='dark'] .auth-switch,
[data-theme='dark'] .auth-features,
[data-theme='dark'] .copy-footer,
[data-theme='dark'] .back-home,
[data-theme='dark'] .top-close,
[data-theme='dark'] .input-icon,
[data-theme='dark'] .input-icon-right,
[data-theme='dark'] .form-input::placeholder,
[data-theme='dark'] .btn-google {
    color: #9fb0cb;
}

[data-theme='dark'] .form-input {
    color: #d6deed;
}

[data-theme='dark'] .form-input:focus {
    background: #121b2d;
}

[data-theme='dark'] .btn-google:hover {
    background: #1b2740;
}

[data-theme='dark'] .back-home:hover,
[data-theme='dark'] .top-close:hover {
    color: #d6deed;
}

@media (max-width: 640px) {
    [data-theme='dark'] body.auth-page {
        background: #0b1220;
    }

    [data-theme='dark'] .auth-card {
        background: #0b1220;
    }
}

/* ===== AUTH DARK VISUAL DIRECTION ===== */
[data-theme='dark'] body.auth-page {
    background:
        radial-gradient(circle at 12% -12%, rgba(37, 99, 235, .24), transparent 34%),
        radial-gradient(circle at 92% 0%, rgba(16, 185, 129, .10), transparent 34%),
        linear-gradient(180deg, #09101d 0%, #0b1322 44%, #0a1220 100%);
}

[data-theme='dark'] .auth-card,
[data-theme='dark'] .btn-google,
[data-theme='dark'] .form-input,
[data-theme='dark'] .divider::before,
[data-theme='dark'] .divider::after {
    background: linear-gradient(180deg, rgba(18, 28, 46, .92), rgba(16, 25, 41, .92));
    border-color: rgba(94, 130, 187, .30);
}

[data-theme='dark'] .auth-card {
    box-shadow: 0 20px 52px rgba(6, 10, 21, .46);
}

[data-theme='dark'] .theme-toggle {
    background: linear-gradient(180deg, rgba(19, 30, 49, .95), rgba(14, 22, 38, .95));
    border-color: rgba(94, 130, 187, .42);
    color: #d6deed;
    box-shadow: 0 14px 36px rgba(4, 9, 18, .50);
}
