/**
 * Tosbaware Auth System - Enterprise Edition
 * Premium Design inspired by Stripe, Linear, Vercel
 * Clean, Minimalist, Powerful
 */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors - Premium Blue */
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --primary-glow: rgba(14, 165, 233, 0.4);

    /* Accent */
    --accent: #38bdf8;

    /* Backgrounds */
    --bg-base: #030712;
    --bg-elevated: rgba(17, 24, 39, 0.8);
    --bg-card: rgba(17, 24, 39, 0.6);
    --bg-input: rgba(17, 24, 39, 0.9);

    /* Borders */
    --border-subtle: rgba(75, 85, 99, 0.4);
    --border-focus: rgba(14, 165, 233, 0.5);

    /* Text */
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* States */
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 60px -15px var(--primary-glow);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* ===== AMBIENT BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(14, 165, 233, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(56, 189, 248, 0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Subtle Grid */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black, transparent);
    pointer-events: none;
    z-index: 0;
}

/* ===== CONTAINER ===== */
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* ===== CARD ===== */
.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
}

/* Top Accent Line */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

/* ===== LOGO ===== */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}

.auth-logo p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    outline: none;
    transition: all 0.15s ease;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:hover {
    border-color: rgba(75, 85, 99, 0.6);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== CHECKBOX ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.forgot-password:hover {
    color: var(--accent);
}

/* ===== KVKK SECTION ===== */
.kvkk-section {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.kvkk-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.checkbox-group:last-child {
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-group label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-group label a:hover {
    text-decoration: underline;
}

/* ===== BUTTON ===== */
.btn-primary {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 0 20px -5px var(--primary-glow);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

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

/* Shimmer Effect */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::after {
    left: 100%;
}

/* ===== TURNSTILE ===== */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

/* ===== FOOTER ===== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-footer a:hover {
    color: var(--accent);
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ===== SOCIAL BUTTONS ===== */
.social-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-social {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-social:hover {
    background: var(--bg-elevated);
    border-color: rgba(75, 85, 99, 0.6);
}

.btn-social svg {
    width: 18px;
    height: 18px;
}

/* ===== TRUST BADGES ===== */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trust-badge svg {
    width: 14px;
    height: 14px;
    color: var(--success);
}

/* ===== STRONG VISUAL FEEDBACK ===== */

/* Input States */
.form-group.error input {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    animation: shake 0.4s ease;
}

.form-group.success input {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2) !important;
}

.form-group .error-message {
    display: block;
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
    animation: fadeIn 0.2s ease;
}

.form-group .success-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success);
    font-size: 16px;
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* Loading Button State */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-width: 320px;
    max-width: 420px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4.7s forwards;
    font-size: 14px;
    color: var(--text-primary);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    color: var(--text-secondary);
    font-size: 13px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 0 12px;
    animation: shrink 5s linear forwards;
}

@keyframes shrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ===== PASSWORD STRENGTH METER ===== */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-fill.weak {
    width: 25%;
    background: var(--error);
}

.strength-fill.fair {
    width: 50%;
    background: var(--warning);
}

.strength-fill.good {
    width: 75%;
    background: #84cc16;
}

.strength-fill.strong {
    width: 100%;
    background: var(--success);
}

.strength-text {
    font-size: 11px;
    color: var(--text-muted);
}

.strength-text.weak {
    color: var(--error);
}

.strength-text.fair {
    color: var(--warning);
}

.strength-text.good {
    color: #84cc16;
}

.strength-text.strong {
    color: var(--success);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeIn 0.4s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        padding: 32px 24px;
    }

    .auth-logo h1 {
        font-size: 22px;
    }

    .trust-badges {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .social-buttons {
        flex-direction: column;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        padding: 32px 24px;
    }

    .auth-logo h1 {
        font-size: 22px;
    }

    .trust-badges {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .social-buttons {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
    }
}

/* ===== COMPACT LAYOUT ===== */

/* Two Column Form Row */
.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* Collapsible KVKK Accordion */
.kvkk-accordion {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.kvkk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(17, 24, 39, 0.5);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.kvkk-header:hover {
    background: rgba(17, 24, 39, 0.7);
}

.kvkk-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kvkk-header .toggle-icon {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.kvkk-accordion.open .toggle-icon {
    transform: rotate(180deg);
}

.kvkk-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
}

.kvkk-accordion.open .kvkk-content {
    max-height: 400px;
    padding: 16px;
}

/* Compact Checkbox Group */
.kvkk-content .checkbox-group {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.kvkk-content .checkbox-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Smaller trust badges */
.trust-badges-compact {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    font-size: 10px;
}

.trust-badges-compact .trust-badge {
    gap: 4px;
}

.trust-badges-compact .trust-badge svg {
    width: 12px;
    height: 12px;
}

/* Toast Compatibility Layer */
.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Compact Card Option */
.auth-card.compact {
    padding: 32px 28px;
}

.auth-card.compact .auth-logo {
    margin-bottom: 20px;
}

.auth-card.compact .form-group {
    margin-bottom: 14px;
}

.auth-card.compact .kvkk-section {
    margin: 16px 0;
    padding: 14px;
}