/* SpeakTing — login split layout */
:root {
    --st-primary: #27B497;
    --st-primary-dark: #1f967d;
    --st-primary-light: #e8f7f3;
    --st-black: #010101;
    --st-text-muted: #5c5c5c;
    --st-border: #e8ebe9;
    --st-bg-soft: #f6faf9;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--st-black);
    background: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-page {
    display: flex;
    min-height: 100vh;
}

/* Left visual — ~2/3 */
.auth-visual {
    flex: 0 0 66.666%;
    max-width: 66.666%;
    position: relative;
    overflow: hidden;
    background: var(--st-black);
}
.auth-visual-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
}
.auth-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(1, 1, 1, 0.55) 0%, rgba(39, 180, 151, 0.35) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    color: #fff;
}
.auth-visual-content h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: .75rem;
    max-width: 480px;
}
.auth-visual-content p {
    font-size: 1rem;
    opacity: .9;
    max-width: 420px;
    line-height: 1.6;
}
.auth-visual-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: .35rem .9rem;
    font-size: .8125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    width: fit-content;
}

/* Right panel — ~1/3 */
.auth-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}
.auth-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
}
.auth-home-link {
    font-size: .875rem;
    font-weight: 500;
    color: var(--st-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: color .2s;
}
.auth-home-link:hover { color: var(--st-primary); }

.auth-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 2.5rem 3rem;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}

.auth-logo {
    margin-bottom: 2rem;
}
.auth-logo a {
    display: inline-block;
}
.auth-logo img {
    height: 40px;
    width: auto;
    display: block;
}

.auth-heading {
    margin-bottom: 1.75rem;
}
.auth-heading h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--st-black);
    margin-bottom: .35rem;
    letter-spacing: -0.02em;
}
.auth-heading p {
    color: var(--st-text-muted);
    font-size: .9375rem;
}

.form-group {
    position: relative;
    margin-bottom: 1.15rem;
}
.input-wrap {
    position: relative;
}
.input-wrap .input-icon,
.input-wrap .password-toggle,
.input-wrap .status-icon {
    top: 50%;
    transform: translateY(-50%);
}
.input-wrap .password-toggle:hover {
    transform: translateY(-50%);
}
.form-control {
    width: 100%;
    border: 1.5px solid var(--st-border);
    border-radius: 12px;
    padding: .9rem 1rem .9rem 2.75rem;
    font: inherit;
    font-size: 1rem;
    background: var(--st-bg-soft);
    color: var(--st-black);
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--st-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(39, 180, 151, 0.15);
}
.form-control::placeholder { color: #9ca3af; }

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--st-primary);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.password-toggle {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--st-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s;
    z-index: 2;
}
.password-toggle:hover { color: var(--st-primary); }

.btn-login,
.btn-register,
.btn-reset {
    width: 100%;
    background: var(--st-primary);
    border: none;
    border-radius: 999px;
    padding: .9rem 1.5rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: .5rem;
    box-shadow: 0 4px 14px rgba(39, 180, 151, 0.3);
}
.btn-login:hover:not(:disabled),
.btn-register:hover:not(:disabled),
.btn-reset:hover:not(:disabled) {
    background: var(--st-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(39, 180, 151, 0.35);
}
.btn-login:disabled,
.btn-register:disabled,
.btn-reset:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .8s linear infinite;
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.links-section {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--st-border);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .5rem 1rem;
}
.links-section a {
    color: var(--st-primary);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: color .2s;
}
.links-section a:hover { color: var(--st-primary-dark); }
.links-section .separator {
    color: var(--st-border);
    user-select: none;
}

.alert {
    border-radius: 12px;
    margin-bottom: 1.15rem;
    padding: .85rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    font-size: .875rem;
    animation: auth-slide .3s ease;
}
@keyframes auth-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.alert-success {
    background: var(--st-primary-light);
    color: #0f766e;
    border: 1px solid rgba(39, 180, 151, 0.3);
}
.alert-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.alert i { flex-shrink: 0; margin-top: 2px; }

/* Register / extended forms */
.auth-panel--scroll { overflow-y: auto; }
.auth-form-wrap--wide { max-width: 520px; }
.auth-form-wrap--scroll {
    justify-content: flex-start;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--st-black);
    margin-bottom: .4rem;
}
.form-group--has-status .form-control { padding-right: 2.75rem; }
.form-group--password .form-control { padding-right: 2.75rem; }

.status-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}
.status-icon.text-success { color: var(--st-primary); }
.status-icon.text-danger { color: #b91c1c; }
.status-icon.text-muted { color: var(--st-text-muted); }

#keyCode.is-valid,
#keyCode.is-invalid { background-image: none !important; }
.form-control.is-valid { border-color: var(--st-primary); }
.form-control.is-invalid { border-color: #b91c1c; }

.password-requirements {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    background: var(--st-bg-soft);
    border: 1px solid var(--st-border);
    font-size: .8125rem;
}
.password-requirements p {
    font-weight: 600;
    color: var(--st-text-muted);
    margin-bottom: .5rem;
}
.password-requirements ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.password-requirements li {
    margin-bottom: .25rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.password-requirements li.text-success { color: var(--st-primary); }
.password-requirements li.text-danger { color: #b91c1c; }
.password-requirements li i { font-size: .5rem; }
.password-requirements li.text-success i { font-size: .875rem; }

.info-box {
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    background: var(--st-bg-soft);
    border: 1px solid var(--st-border);
    border-left: 3px solid var(--st-primary);
}
.info-box h6 {
    font-size: .875rem;
    font-weight: 600;
    color: var(--st-black);
    margin-bottom: .35rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.info-box h6 i { color: var(--st-primary); }
.info-box p {
    font-size: .8125rem;
    color: var(--st-text-muted);
    line-height: 1.55;
    margin: 0;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(1, 1, 1, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.loading-content {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    width: 300px;
}
.loading-spinner-large {
    width: 48px;
    height: 48px;
    border: 3px solid var(--st-border);
    border-top-color: var(--st-primary);
    border-radius: 50%;
    animation: auth-spin .8s linear infinite;
    margin: 0 auto 1.25rem;
}
.loading-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--st-black);
    margin-bottom: .25rem;
}
.loading-subtext {
    font-size: .875rem;
    color: var(--st-text-muted);
}

@media (max-width: 960px) {
    .auth-page { flex-direction: column; }
    .auth-visual { display: none; }
    .auth-form-wrap {
        padding: 1.5rem 1.5rem 2.5rem;
        max-width: 100%;
    }
    .auth-panel-top { padding: 1rem 1.5rem; }
}

@media (max-width: 480px) {
    .auth-heading h1 { font-size: 1.5rem; }
    .form-control { font-size: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .links-section { flex-direction: column; gap: .75rem; }
    .links-section .separator { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
