/* =============================================================================
   Auth Component CSS - 1e1ders Platform
   =============================================================================
   Split-screen auth layout, floating labels, animations, password strength
   indicator, role selection cards ve responsive tasarım.
   ============================================================================= */

/* =============================================================================
   Auth Layout (Split Screen)
   ============================================================================= */
.auth-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sol Panel: Branding --- */
.auth-branding {
    position: relative;
    width: 44%;
    min-height: 100vh;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 40%, #818cf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
}

.auth-branding-inner {
    position: relative;
    z-index: 2;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    justify-content: space-between;
}

.auth-logo {
    text-decoration: none;
    margin-bottom: 3rem;
}

.auth-logo .logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.02em;
}

.auth-logo .logo-accent {
    color: rgba(255, 255, 255, 0.7);
}

.auth-branding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-branding-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.auth-branding-desc {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 3rem;
}

/* İstatistikler */
.auth-branding-stats {
    display: flex;
    gap: 2rem;
}

.auth-stat {
    text-align: center;
}

.auth-stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.auth-stat-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.auth-branding-footer {
    margin-top: 3rem;
}

.auth-branding-footer p {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Dekoratif şekiller */
.auth-branding-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation: floatShape 20s ease-in-out infinite;
}

.shape-2 {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: -60px;
    animation: floatShape 25s ease-in-out infinite reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 20%;
    background: rgba(255, 255, 255, 0.04);
    animation: floatShape 18s ease-in-out infinite;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.05); }
    50% { transform: translate(-10px, 15px) scale(0.95); }
    75% { transform: translate(15px, 10px) scale(1.02); }
}

/* --- Sağ Panel: Form --- */
.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--color-gray-50);
    overflow-y: auto;
}

.auth-content-inner {
    width: 100%;
    max-width: 460px;
    animation: authFadeIn 0.5s ease forwards;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   Auth Card
   ============================================================================= */
.auth-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 2.5rem;
    border: 1px solid var(--color-gray-100);
}

.auth-card:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--color-primary-bg);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.auth-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: var(--color-gray-500);
    line-height: 1.5;
}

/* =============================================================================
   Floating Label Input Groups
   ============================================================================= */
.auth-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.auth-input-group .auth-input {
    width: 100%;
    padding: 1rem 1rem 0.625rem;
    padding-right: 3rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--color-gray-800);
    background: var(--color-gray-50);
    border: 2px solid var(--color-gray-200);
    border-radius: 0.625rem;
    outline: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.auth-input-group .auth-input::placeholder {
    color: transparent;
}

.auth-input-group .auth-label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: var(--color-gray-400);
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
}

/* Floating label aktif durumu */
.auth-input-group .auth-input:focus ~ .auth-label,
.auth-input-group .auth-input:not(:placeholder-shown) ~ .auth-label {
    top: 0.5rem;
    transform: translateY(0);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Focus state */
.auth-input-group .auth-input:focus {
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Hata state */
.auth-input-group.has-error .auth-input {
    border-color: var(--color-danger);
}

.auth-input-group.has-error .auth-input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.auth-input-group.has-error .auth-label {
    color: var(--color-danger);
}

/* Başarı state */
.auth-input-group.has-success .auth-input {
    border-color: var(--color-success);
}

.auth-input-group.has-success .auth-input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* Input ikonu */
.auth-input-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--color-gray-400);
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input-group .auth-input:focus ~ .auth-input-icon {
    color: var(--color-primary);
}

/* Şifre göster/gizle butonu */
.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--color-gray-400);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 2;
    background: none;
    border: none;
    font-size: 1rem;
}

.auth-password-toggle:hover {
    color: var(--color-gray-600);
}

/* Hata mesajı */
.auth-field-error {
    display: none;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-danger);
    padding-left: 0.25rem;
    animation: errorSlideIn 0.2s ease;
}

.auth-input-group.has-error .auth-field-error {
    display: block;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Başarı ikonu */
.auth-field-success {
    display: none;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--color-success);
    font-size: 0.875rem;
}

.auth-input-group.has-success .auth-field-success {
    display: block;
}

.auth-input-group.has-success .auth-input-icon {
    display: none;
}

/* =============================================================================
   Password Strength Meter
   ============================================================================= */
.password-strength {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.password-strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 0.375rem;
}

.password-strength-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--color-gray-200);
    transition: background 0.3s ease;
}

.password-strength-segment.active {
    background: var(--color-gray-400);
}

/* Renk seviyeleri */
.password-strength[data-score="0"] .password-strength-segment.active,
.password-strength[data-score="1"] .password-strength-segment.active {
    background: var(--color-danger);
}

.password-strength[data-score="2"] .password-strength-segment.active {
    background: var(--color-warning);
}

.password-strength[data-score="3"] .password-strength-segment.active {
    background: #f59e0b;
}

.password-strength[data-score="4"] .password-strength-segment.active {
    background: var(--color-success);
}

.password-strength[data-score="5"] .password-strength-segment.active {
    background: #059669;
}

.password-strength-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.password-strength[data-score="0"] .password-strength-label,
.password-strength[data-score="1"] .password-strength-label {
    color: var(--color-danger);
}

.password-strength[data-score="2"] .password-strength-label {
    color: var(--color-warning);
}

.password-strength[data-score="3"] .password-strength-label {
    color: #d97706;
}

.password-strength[data-score="4"] .password-strength-label {
    color: var(--color-success);
}

.password-strength[data-score="5"] .password-strength-label {
    color: #059669;
}

/* =============================================================================
   Role Selection Cards
   ============================================================================= */
.role-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.role-option {
    cursor: pointer;
}

.role-option input[type="radio"] {
    display: none;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--color-gray-200);
    border-radius: 0.75rem;
    background: var(--color-gray-50);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.role-card:hover {
    border-color: var(--color-gray-300);
    background: white;
}

.role-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--color-gray-100);
    color: var(--color-gray-400);
    transition: all 0.25s ease;
}

.role-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-600);
    transition: color 0.25s ease;
}

.role-card-desc {
    font-size: 0.6875rem;
    color: var(--color-gray-400);
    text-align: center;
    line-height: 1.4;
}

/* Seçili durum */
.role-option input:checked + .role-card {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
}

.role-option input:checked + .role-card::before {
    transform: scaleX(1);
}

.role-option input:checked + .role-card .role-card-icon {
    background: var(--color-primary);
    color: white;
}

.role-option input:checked + .role-card .role-card-name {
    color: var(--color-primary);
}

/* =============================================================================
   Auth Form Elements
   ============================================================================= */
.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.auth-forgot-link {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    color: var(--color-primary-dark);
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.auth-submit-btn.loading .btn-text {
    opacity: 0;
}

.auth-submit-btn.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    position: absolute;
}

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

/* =============================================================================
   Auth Divider
   ============================================================================= */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-gray-200);
}

.auth-divider span {
    font-size: 0.8125rem;
    color: var(--color-gray-400);
    font-weight: 500;
}

/* =============================================================================
   Auth Footer
   ============================================================================= */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

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

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

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-gray-500);
    font-weight: 500;
    margin-top: 1.5rem;
    transition: color 0.15s ease;
}

.auth-back-link:hover {
    color: var(--color-primary);
}

/* =============================================================================
   Email Availability Indicator
   ============================================================================= */
.email-status {
    display: none;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    animation: errorSlideIn 0.2s ease;
}

.email-status.visible {
    display: flex;
}

.email-status.available {
    color: var(--color-success);
}

.email-status.unavailable {
    color: var(--color-danger);
}

.email-status.checking {
    color: var(--color-gray-400);
}

.email-status .spinner-tiny {
    width: 12px;
    height: 12px;
    border: 2px solid var(--color-gray-300);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* =============================================================================
   Terms & Privacy
   ============================================================================= */
.auth-terms {
    font-size: 0.75rem;
    color: var(--color-gray-400);
    text-align: center;
    line-height: 1.6;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.auth-terms a {
    color: var(--color-gray-600);
    font-weight: 500;
}

.auth-terms a:hover {
    color: var(--color-primary);
}

/* =============================================================================
   Success State (Email Sent, etc.)
   ============================================================================= */
.auth-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-success-bg);
    color: var(--color-success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* =============================================================================
   Responsive Design
   ============================================================================= */
@media (max-width: 1024px) {
    .auth-branding {
        width: 40%;
        padding: 2rem;
    }

    .auth-branding-title {
        font-size: 1.75rem;
    }

    .auth-branding-stats {
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .auth-layout {
        flex-direction: column;
    }

    .auth-branding {
        width: 100%;
        min-height: auto;
        padding: 2rem 1.5rem;
    }

    .auth-branding-content {
        display: none;
    }

    .auth-branding-inner {
        min-height: auto;
        align-items: center;
    }

    .auth-logo {
        margin-bottom: 0;
    }

    .auth-branding-footer {
        display: none;
    }

    .auth-branding-shapes {
        display: none;
    }

    .auth-content {
        padding: 1.5rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-form-row {
        grid-template-columns: 1fr;
    }

    .role-selection {
        grid-template-columns: 1fr;
    }

    .auth-remember-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .auth-card {
        padding: 1.25rem;
    }

    .auth-title {
        font-size: 1.375rem;
    }
}

/* =============================================================================
   Flash messages override for auth pages
   ============================================================================= */
.auth-page .flash-container {
    top: 1rem;
    right: 1rem;
    z-index: 500;
}
