/* ============================================================
   auth.css — Dohub Auth Pages Design System
   Kinetic split-panel layout with brand identity
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Manrope:wght@300;400;500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---- Root tokens ---- */
:root {
    --primary:              #00113a;
    --primary-container:    #002366;
    --primary-dim:          #b3c5ff;
    --secondary:            #b6171e;
    --secondary-container:  #da3433;
    --surface:              #f9f9fc;
    --surface-low:          #f3f3f6;
    --surface-high:         #e8e8ea;
    --outline:              #757682;
    --outline-var:          #c5c6d2;
    --on-surface:           #1a1c1e;
    --on-surface-var:       #444650;
    --on-primary:           #ffffff;
    --radius-sm:            0.375rem;
    --radius-md:            0.625rem;
    --radius-lg:            1rem;
    --font-headline:        'Space Grotesk', sans-serif;
    --font-body:            'Inter', sans-serif;
    --font-label:           'Manrope', sans-serif;
}

/* ---- Layout wrapper override for auth pages ---- */
body.auth-page > .auth-root {
    display: contents; /* Let auth-canvas handle all layout */
    background: transparent !important;
}


/* ---- Layout shell ---- */
body.auth-page {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}


/* Kinetic dot grid background */
body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-color: var(--primary);
    background-image: radial-gradient(circle at 2px 2px, rgba(182,23,30,0.05) 1px, transparent 0);
    background-size: 40px 40px;
    opacity: 0.40;
    z-index: 0;
    pointer-events: none;
}

.auth-page .main-content {
    padding-top: 0 !important;
}

/* ---- Main canvas ---- */
.auth-canvas {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

/* ---- Left brand column ---- */
.auth-brand {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 40%;
    background: var(--primary);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .auth-brand { display: flex; }
}

.auth-brand-top {}

.auth-brand-logo {
    font-family: var(--font-headline);
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: -0.04em;
    line-height: 1;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.auth-brand-tagline {
    font-family: var(--font-label);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary-dim);
    opacity: 0.8;
}

.auth-brand-bottom {}

.auth-brand-headline {
    font-family: var(--font-headline);
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.auth-brand-headline em {
    color: var(--secondary);
    font-style: italic;
}

.auth-brand-desc {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: #cbd5e1;
    line-height: 1.7;
    max-width: 280px;
}

/* Octagonal decorations */
.octagon {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.auth-brand-deco-1 {
    position: absolute;
    bottom: -5rem;
    right: -5rem;
    width: 20rem;
    height: 20rem;
    background: var(--primary-container);
    opacity: 0.3;
}

.auth-brand-deco-2 {
    position: absolute;
    top: 50%;
    left: -2.5rem;
    width: 6rem;
    height: 6rem;
    border: 2px solid rgba(182,23,30,0.2);
}

/* Floating badge */
.auth-floating-badge {
    display: none;
    position: absolute;
    top: -1.5rem;
    right: -1.5rem;
    background: var(--secondary);
    padding: 1rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    z-index: 10;
}

@media (min-width: 1024px) {
    .auth-floating-badge { display: block; }
}

.auth-floating-badge .badge-icon {
    font-size: 1.875rem;
    color: #fff;
}

/* ---- Right form column ---- */
.auth-panel-wrap {
    width: 100%;
    background: #fff;
    box-shadow: 40px 0 80px rgba(0,17,58,0.1);
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) {
    .auth-panel-wrap {
        width: 60%;
        padding: 4rem;
    }
}

/* Mobile logo */
.auth-mobile-logo {
    display: block;
    font-family: var(--font-headline);
    font-size: 1.875rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: -0.04em;
    text-decoration: none;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .auth-mobile-logo { display: none; }
}

/* ---- Tabs ---- */
.auth-tabs {
    display: flex;
    position: relative;
    background: var(--surface-low);
    padding: 4px;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.625rem;
    background: none;
    border: none;
    font-family: var(--font-label);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--outline);
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    letter-spacing: 0.02em;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #fff;
    border-radius: calc(var(--radius-lg) - 4px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* ---- Panel heading ---- */
.auth-panel-heading {
    margin-bottom: 2rem;
}

.auth-panel-title {
    font-family: var(--font-headline);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-left: -2px;
    margin-bottom: 0.5rem;
}

.auth-panel-subtitle {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--on-surface-var);
}

/* ---- Alerts ---- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

/* ---- Auth forms ---- */
.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block !important;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Label */
.auth-label {
    font-family: var(--font-label);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--on-surface-var);
    display: block;
    margin-left: 2px;
}

/* Input wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--outline);
    pointer-events: none;
    font-size: 1.1rem;
    /* for Material Symbols */
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400;
    user-select: none;
}

/* Base input / select / simple-input */
.auth-input,
.simple-input {
    width: 100%;
    padding: 0.875rem 1.125rem;
    background: var(--surface-low);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--on-surface);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

/* When inside a wrapper with an icon */
.input-wrapper .auth-input,
.input-wrapper input {
    padding: 0.875rem 1.125rem;
    padding-left: 2.75rem;
    width: 100%;
    background: var(--surface-low);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--on-surface);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input:focus,
.simple-input:focus,
.input-wrapper input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 17, 58, 0.07);
}

/* Icon suffix (e.g. verified) */
.input-suffix-icon {
    position: absolute;
    right: 1rem;
    color: var(--outline);
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400;
    pointer-events: none;
    user-select: none;
    font-size: 1.1rem;
}

/* Password toggle */
.password-wrapper { position: relative; }

.password-toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: var(--outline);
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle:hover { color: var(--primary); }
.password-toggle:focus { outline: none; }

.eye-icon { display: block; transition: opacity 0.2s; }

/* Select arrow */
select.auth-input,
select.simple-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23757682' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Validation */
.field-validation-error,
.text-danger {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 2px;
    display: block;
}

.input-validation-error { border-color: #fecaca !important; }

/* Checkbox */
.auth-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.auth-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 4px;
    border: 1.5px solid var(--outline-var);
    accent-color: var(--secondary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-checkbox-label {
    font-family: var(--font-label);
    font-size: 0.75rem;
    color: var(--on-surface-var);
    line-height: 1.5;
    cursor: pointer;
}

.auth-checkbox-label a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

/* Forgot link */
.forgot-link {
    display: block;
    text-align: right;
    font-family: var(--font-label);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    margin-top: -0.25rem;
}

.forgot-link:hover { text-decoration: underline; }

/* ---- Submit button ---- */
.btn-submit {
    width: 100%;
    padding: 1.125rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-headline);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 14px rgba(0, 17, 58, 0.2);
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    margin-top: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 17, 58, 0.28);
}

.btn-submit:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-submit .arrow-icon {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.btn-submit:hover .arrow-icon {
    transform: translateX(4px);
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Sign-in link footer ---- */
.auth-switch {
    margin-top: 2rem;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--on-surface-var);
}

.auth-switch a {
    color: var(--secondary);
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
}

.auth-switch a:hover { text-decoration: underline; }

/* ---- Responsive tweaks ---- */
@media (max-width: 640px) {
    .auth-panel-wrap { padding: 1.5rem; }
    .auth-panel-title { font-size: 1.75rem; }
}

/* ============================================================
   LOGIN PAGE SPECIFIC STYLES
   ============================================================ */

/* Canvas override — card appearance, rounded, shadowed */
.auth-canvas-login {
    max-width: 980px;
    padding: 0;
    align-items: stretch;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.18);
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 2rem auto;
    min-height: auto;
}

@media (max-width: 767px) {
    .auth-canvas-login {
        flex-direction: column;
        border-radius: 0;
        margin: 0;
        min-height: 100vh;
    }
}

/* ---- Login brand panel (58% width, gradient + image) ---- */
.auth-brand-login {
    width: 58.33%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    padding: 3rem;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand-login::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l30 30-30 30-30-30z' fill='%23ffffff' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 40px 40px;
    pointer-events: none;
}

@media (max-width: 767px) {
    .auth-brand-login { width: 100%; min-height: 40vh; }
}

.auth-brand-tagline-login {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    color: var(--primary-dim);
    opacity: 0.85;
    margin-top: 1rem;
    max-width: 22rem;
    line-height: 1.6;
}

/* Image section */
.auth-brand-image-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-brand-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-brand-sep-line {
    width: 3rem;
    height: 2px;
    background: var(--secondary);
    flex-shrink: 0;
}

.auth-brand-sep-label {
    font-family: var(--font-label);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.55);
}

.auth-brand-image-wrap {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.auth-brand-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2);
    opacity: 0.42;
    transition: opacity 0.7s ease;
}

.auth-brand-image-wrap:hover .auth-brand-image {
    opacity: 0.62;
}

.auth-brand-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 17, 58, 0.8) 0%, transparent 60%);
}

/* Decorative rotated border */
.auth-brand-deco-corner {
    position: absolute;
    bottom: -5rem;
    left: -5rem;
    width: 20rem;
    height: 20rem;
    border: 40px solid rgba(182, 23, 30, 0.10);
    transform: rotate(12deg);
    pointer-events: none;
}

/* ---- Login form panel (42% width) ---- */
.auth-panel-wrap-login {
    width: 41.67%;
    background: #fff;
    box-shadow: none;
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 767px) {
    .auth-panel-wrap-login { width: 100%; padding: 2rem 1.5rem; }
}

/* ---- Focus-reactive icons ---- */
.input-icon-focusable {
    color: var(--outline-var);
    transition: color 0.2s ease;
}

.input-group-focus:focus-within .input-icon-focusable {
    color: var(--secondary);
}

/* ---- Label + forgot link on same row ---- */
.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.auth-label-row .auth-label { margin-left: 0; }

.auth-label-row .forgot-link {
    font-size: 0.75rem;
    font-family: var(--font-label);
    font-weight: 700;
    color: var(--secondary);
    text-decoration: none;
    margin-top: 0;
}

.auth-label-row .forgot-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---- Login submit button variant ---- */
.btn-submit-login {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9375rem;
    padding: 1.25rem 2rem;
}

.btn-submit-login .arrow-icon { font-size: 1.375rem; }

/* ---- Auth switch card (bordered Üye Ol section) ---- */
.auth-switch-card {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--surface-high);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auth-switch-label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--outline);
}

.btn-outline-register {
    font-family: var(--font-label);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 1.5px solid rgba(197, 198, 210, 0.5);
    border-radius: 999px;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-outline-register:hover {
    background: var(--surface-low);
    border-color: var(--outline-var);
}

/* Mobile brand footer */
.auth-mobile-brand-footer {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

@media (min-width: 768px) {
    .auth-mobile-brand-footer { display: none; }
}
