/**
 * Auth ekranları (giriş, kayıt, hoş geldiniz) — Bootstrap + crm-ui-v2-layer ile birlikte.
 * body: class="auth-page auth-page--centered" | auth-page--welcome
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.auth-page {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.auth-page--centered {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
}

.auth-page--welcome {
    padding: 24px 16px 48px;
}

@keyframes auth-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-card,
    .register-card {
        animation: none;
    }

    .btn-login:hover,
    .btn-register-submit:hover,
    .btn-welcome-panel:hover {
        transform: none;
    }
}

/* ——— Loading overlay (login / register) ——— */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
    }
}

/* ——— Login ——— */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: auth-fade-in 0.4s ease;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1.5rem;
    text-align: center;
    color: white;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-header p {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 400;
}

.login-body {
    padding: 2rem 1.5rem;
}

.login-body .form-floating {
    margin-bottom: 1.25rem;
    position: relative;
}

.login-body .form-floating > .form-control {
    height: 52px;
    border-radius: 12px;
    border: 1.5px solid #e5e7eb;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    padding-left: 2.75rem;
    background: #f9fafb;
    font-weight: 400;
}

.login-body .form-floating > .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.login-body .form-floating > label {
    padding: 0.875rem 0.75rem 0.875rem 2.75rem;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.login-body .form-floating > .form-control:focus ~ label,
.login-body .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #667eea;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.1rem);
}

.login-body .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    z-index: 5;
    transition: color 0.2s ease;
}

.login-body .form-floating:focus-within .input-icon {
    color: #667eea;
}

.login-body .password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    z-index: 10;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.login-body .password-toggle:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.login-body .form-check {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.login-body .form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 4px;
    border: 1.5px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0;
}

.login-body .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.login-body .form-check-label {
    margin-left: 0.625rem;
    color: #4b5563;
    font-weight: 400;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-body .alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.demo-info-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f5f3ff 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.06);
}

.demo-info-box .info-text {
    font-size: 0.8125rem;
    color: #4b5563;
    line-height: 1.55;
    margin-bottom: 0.75rem;
}

.demo-info-box .demo-credential {
    font-size: 0.8125rem;
    color: #374151;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px dashed #667eea;
}

.demo-info-box .demo-credential strong {
    color: #667eea;
    font-weight: 600;
}

.demo-info-box .demo-warning {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    line-height: 1.45;
}

.demo-info-box .demo-warning i {
    color: #f59e0b;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.login-body .invalid-feedback {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
}

.login-body .form-control.is-invalid {
    border-color: #ef4444;
}

.login-body .form-control.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ——— Register ——— */
.register-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 880px;
}

.register-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: auth-fade-in 0.4s ease;
}

.register-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.75rem 1.5rem;
    text-align: center;
    color: white;
}

.register-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.register-header p {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 400;
    margin: 0;
}

.register-body {
    padding: 1.75rem 1.5rem;
}

.register-body .form-control,
.register-body .input-group-text {
    border-radius: 12px;
}

.register-body .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.register-body .input-group .input-group-text {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    font-size: 0.875rem;
}

.package-option {
    display: block;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.package-option:hover {
    border-color: #d1d5db;
}

.package-option.package-selected-demo {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.package-option.package-selected-paid {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.package-option .form-check-input {
    margin-top: 0.35rem;
}

.btn-register-submit {
    width: 100%;
    padding: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-register-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-register-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.demo-hint {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ——— Welcome ——— */
.welcome-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.welcome-hero-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.welcome-hero-icon i {
    font-size: 2.5rem;
    color: #059669;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.btn-welcome-panel {
    padding: 0.875rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-welcome-panel:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}

.contact-tile {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s, background 0.2s;
}

.contact-tile:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.06);
    color: inherit;
}

/* ——— Mobil ——— */
@media (max-width: 576px) {
    .auth-page--centered {
        padding: 12px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-body {
        padding: 1.5rem 1.25rem;
    }

    .login-header {
        padding: 1.75rem 1.25rem;
    }

    .login-header h1 {
        font-size: 1.375rem;
    }

    .login-header p {
        font-size: 0.8125rem;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-body .form-floating > .form-control {
        height: 48px;
        font-size: 0.875rem;
    }

    .login-body .form-floating > label {
        font-size: 0.8125rem;
    }

    .btn-login {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .register-body {
        padding: 1.25rem 1rem;
    }

    .register-card {
        border-radius: 16px;
    }
}
