/* ═══════════════════════════════════════════════════════════════════════
   CUSTOM BUTTON & COMPONENT STYLES
   Design System for QR Code Application
   
   Color Palette:
     kair-primary:   #272757
     kair-hover:     #0f0e47
     kair-light:     #505081
     kair-lighter:   #8686ac
     kair-surface:   #f5f5fa
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   BASE TYPOGRAPHY HELPERS
   ───────────────────────────────────────── */
p, li, td, th, label, span {
    font-family: inherit;
}

/* ─────────────────────────────────────────
   PRIMARY BUTTON (Nav / general use)
   ───────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #272757 0%, #4f46e5 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 200ms ease, box-shadow 200ms ease, transform 150ms ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 200ms ease, box-shadow 200ms ease, transform 150ms ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(39, 39, 87, 0.35);
    transform: translateY(-1px);
}

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

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 39, 87, 0.3);
}

/* ─────────────────────────────────────────
   PRIMARY OUTLINED BUTTON
   ───────────────────────────────────────── */
.btn-primary-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #272757;
    background-color: transparent;
    border: 2px solid #272757;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary-outlined:hover {
    background: linear-gradient(135deg, #272757 0%, #4f46e5 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(39, 39, 87, 0.3);
}

.btn-primary-outlined:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 39, 87, 0.3);
}

/* ─────────────────────────────────────────
   SECONDARY BUTTON
   ───────────────────────────────────────── */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: #374151;
    background-color: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 200ms ease, border-color 200ms ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 39, 87, 0.12);
}

/* ─────────────────────────────────────────
   DANGER BUTTON
   ───────────────────────────────────────── */
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background-color: #dc2626;
    border: 2px solid transparent;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 200ms ease, box-shadow 200ms ease;
    text-decoration: none;
}

.btn-danger:hover {
    background-color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* ─────────────────────────────────────────
   ALERT COMPONENTS
   ───────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ─────────────────────────────────────────
   AUTH PAGE LAYOUT
   Full-page gradient bg — promo left, card right
   ───────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #272757 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

/* Decorative background circles */
.auth-decor-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.06;
    background: #ffffff;
}
.auth-decor-circle-1 { width: 400px; height: 400px; top: -120px; right: -80px; }
.auth-decor-circle-2 { width: 300px; height: 300px; bottom: -100px; left: -60px; }
.auth-decor-circle-3 { width: 200px; height: 200px; top: 40%; left: 10%; opacity: 0.04; }
.auth-decor-circle-4 { width: 150px; height: 150px; bottom: 20%; right: 15%; opacity: 0.03; }

/* Main container — promo left, card right */
.auth-container {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    width: 100%;
    max-width: 56rem;
    min-height: 34rem;
    position: relative;
    z-index: 10;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
    .auth-container {
        flex-direction: row;
    }
}

/* LEFT: Simple promo / branding side */
.auth-promo {
    display: none;
}

@media (min-width: 1024px) {
    .auth-promo {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 45%;
        background: linear-gradient(160deg, #1e1b4b 0%, #272757 50%, #312e81 100%);
        padding: 3rem 2rem;
        position: relative;
        overflow: hidden;
        text-align: center;
    }
}

/* Promo logo */
.auth-promo-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 2rem;
}

.auth-promo-logo img {
    height: 2.5rem;
    width: auto;
}

.auth-promo-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

/* Promo headline */
.auth-promo-headline {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    max-width: 20rem;
}

/* Promo description */
.auth-promo-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    max-width: 20rem;
}

/* RIGHT: White form card */
.auth-card {
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    order: 1;
}

@media (min-width: 1024px) {
    .auth-card {
        width: 55%;
        padding: 3rem 2.5rem;
        order: 2;
    }
}

.auth-card-header {
    width: 100%;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.375rem;
}

.auth-card-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
}

.auth-card-subtitle a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
    transition: color 200ms ease;
}

.auth-card-subtitle a:hover {
    color: #272757;
    text-decoration: underline;
}

/* Promo decorative squares */
.auth-promo-decor-sq {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.375rem;
    pointer-events: none;
}
.auth-promo-decor-sq-1 { width: 3rem; height: 3rem; top: 8%; right: 10%; background: rgba(255,255,255,0.03); }
.auth-promo-decor-sq-2 { width: 2rem; height: 2rem; top: 22%; left: 8%; }
.auth-promo-decor-sq-3 { width: 1.5rem; height: 1.5rem; bottom: 18%; right: 15%; background: rgba(255,255,255,0.03); }
.auth-promo-decor-sq-4 { width: 2.5rem; height: 2.5rem; bottom: 8%; left: 12%; }

/* Trust badges row */
.auth-trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    margin-top: 1rem;
}

.auth-trust-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #06b6d4;
}

.auth-trust-badge svg {
    width: 1rem;
    height: 1rem;
}

.auth-trust-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.25rem;
}

/* Promo floating decoration squares */
.auth-promo-decor-sq {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.375rem;
    pointer-events: none;
}

.auth-promo-decor-sq-1 { width: 3rem; height: 3rem; top: 8%; right: 10%; background: rgba(255,255,255,0.03); }
.auth-promo-decor-sq-2 { width: 2rem; height: 2rem; top: 22%; left: 8%; }
.auth-promo-decor-sq-3 { width: 1.5rem; height: 1.5rem; bottom: 25%; right: 15%; background: rgba(255,255,255,0.03); }
.auth-promo-decor-sq-4 { width: 2.5rem; height: 2.5rem; bottom: 8%; left: 12%; }

/* ─────────────────────────────────────────
   AUTH LOGO
   ───────────────────────────────────────── */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 2.5rem;
}

.auth-logo-img {
    height: 2.25rem;
    width: auto;
    object-fit: contain;
}

.auth-logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: #272757;
    letter-spacing: -0.01em;
}

/* Auth page title */
.auth-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.375rem;
    text-align: left;
    width: 100%;
}

@media (min-width: 1024px) {
    .auth-title {
        font-size: 1.875rem;
    }
}

/* Auth page subtitle */
.auth-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
    text-align: left;
    margin-bottom: 2rem;
    width: 100%;
}

/* Auth checkbox */
.auth-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.25rem;
    border: 1.5px solid #d1d5db;
    accent-color: #272757;
    cursor: pointer;
}

/* ─────────────────────────────────────────
   UNIFIED FORM INPUT
   ───────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
    color: #111827;
    background-color: #f3f4f6;
    border: 1.5px solid transparent;
    border-radius: 0.625rem;
    transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
    appearance: none;
    -webkit-appearance: none;
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #272757;
    box-shadow: 0 0 0 3px rgba(39, 39, 87, 0.08);
}

.form-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Input error state */
.form-input.input-error,
.form-input:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

.form-input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Mobile touch-friendly input */
@media (max-width: 767px) {
    .form-input {
        padding: 0.875rem 1rem;
        font-size: 1rem;     /* 16px prevents iOS zoom */
    }
}

/* ─────────────────────────────────────────
   UNIFIED FORM LABEL
   ───────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* ─────────────────────────────────────────
   UNIFIED FORM GROUP
   ───────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

/* ─────────────────────────────────────────
   AUTH PRIMARY BUTTON (Full-width pill)
   ───────────────────────────────────────── */
.btn-auth-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #272757 0%, #4f46e5 100%);
    border: 2px solid transparent;
    border-radius: 9999px;
    cursor: pointer;
    transition: opacity 200ms ease, box-shadow 200ms ease, transform 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    box-shadow: 0 2px 8px rgba(39, 39, 87, 0.15);
    text-decoration: none;
}

.btn-auth-primary:hover:not(:disabled) {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(39, 39, 87, 0.35);
    transform: translateY(-1px);
}

.btn-auth-primary:active:not(:disabled) {
    transform: translateY(0);
    opacity: 0.85;
}

.btn-auth-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 39, 87, 0.3);
}

.btn-auth-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─────────────────────────────────────────
   OAUTH BUTTON (Google / GitHub etc.)
   ───────────────────────────────────────── */
.btn-oauth {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background-color: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 200ms ease, border-color 200ms ease;
    min-height: 2.75rem;
    text-decoration: none;
}

.btn-oauth:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn-oauth:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 39, 87, 0.1);
}

/* ─────────────────────────────────────────
   AUTH DIVIDER
   ───────────────────────────────────────── */
.auth-divider {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e5e7eb;
}

.auth-divider span {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    text-transform: lowercase;
}

/* ─────────────────────────────────────────
   AUTH LINK
   ───────────────────────────────────────── */
.auth-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #272757;
    text-decoration: none;
    transition: color 200ms ease;
}

.auth-link:hover {
    color: #0f0e47;
    text-decoration: underline;
}

/* ─────────────────────────────────────────
   AUTH MOBILE LAYOUT — clean white page, no card
   ───────────────────────────────────────── */
@media (max-width: 1023px) {
    .auth-page {
        background: #ffffff;
        padding: 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-decor-circle {
        display: none;
    }

    .auth-container {
        border-radius: 0;
        box-shadow: none;
        min-height: auto;
        flex-direction: column;
    }

    .auth-card {
        padding: 1.5rem 1.5rem 2.5rem;
        justify-content: flex-start;
        box-shadow: none;
        min-height: calc(100vh - 3.5rem);
    }
}

/* Mobile logo — visible only below lg breakpoint */
.auth-mobile-logo {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    width: 100%;
    z-index: 20;
    position: relative;
}

.auth-mobile-logo img {
    height: 2rem;
    width: auto;
}

@media (min-width: 1024px) {
    .auth-mobile-logo {
        display: none;
    }
}

/* ─────────────────────────────────────────
   HEADER BUTTON TEXT SIZE
   ───────────────────────────────────────── */
.text-header-btn {
    font-size: 0.8125rem;
}

@media (min-width: 1024px) {
    .text-header-btn {
        font-size: 0.875rem;
    }
}
