/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    --primary:        #3A7D2A;
    --primary-dark:   #2D6221;
    --primary-light:  #67B74A;
    --primary-xlight: #B2E0B2;
    --primary-pale:   #E0F7E6;

    --gray-50:  #fafaf9;
    --gray-100: #f5f1ef;
    --gray-200: #ede8e5;
    --gray-300: #d6cec9;
    --gray-400: #b8aca5;
    --gray-500: #8a7d77;
    --gray-600: #5c5250;
    --gray-700: #3d3533;
    --gray-800: #211e1d;

    --danger:     #dc2626;
    --danger-bg:  #fee2e2;
    --success:    #16a34a;
    --success-bg: #dcfce7;
    --warning:    #a16207;
    --warning-bg: #fef9c3;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--gray-700);
    background-color: var(--gray-100);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: -120px;
    right: -120px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(58, 125, 42, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -140px;
    left: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(58, 125, 42, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Loading Screen ─────────────────────────────────────────── */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-xlight);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 26px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.loading-text {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Login Card ─────────────────────────────────────────────── */
.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeUp 0.25s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Brand Header ───────────────────────────────────────────── */
.card-brand {
    background: #ffffff;
    padding: 28px 32px 18px;
    border-bottom: 1px solid var(--gray-200);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.logo-mark {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    object-fit: contain;
    display: block;
    box-shadow: 0 14px 28px rgba(58, 125, 42, 0.16);
}

.brand-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
    text-align: center;
}

/* ── Card Body ──────────────────────────────────────────────── */
.card-body-area {
    padding: 28px 32px 20px;
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.15s;
    z-index: 1;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* Override Bootstrap .form-control */
.login-card .form-control {
    width: 100%;
    padding: 9px 12px 9px 36px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--gray-700);
    background: var(--primary-pale);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
}

.login-card .form-control::placeholder {
    color: var(--gray-400);
}

.login-card .form-control:focus {
    background: #ffffff;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(58, 125, 42, 0.12) !important;
    outline: none;
}

.login-card .form-control.has-toggle {
    padding-right: 40px;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 6px;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: color 0.15s;
    z-index: 1;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Remember me */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.remember-row .form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin: 0;
}

.remember-row .form-check-label {
    font-size: 13px;
    color: var(--gray-500);
    cursor: pointer;
    margin: 0;
}

.forgot-link {
    font-size: 12.5px;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ── Alert ──────────────────────────────────────────────────── */
#alertContainer {
    margin-bottom: 14px;
}

#alertContainer .alert {
    font-size: 13px;
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    border: none !important;
    animation: slideDown 0.18s ease;
    margin: 0;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

#alertContainer .alert-danger  { background: var(--danger-bg)  !important; color: #991b1b !important; }
#alertContainer .alert-success { background: var(--success-bg) !important; color: #065f46 !important; }
#alertContainer .alert-warning { background: var(--warning-bg) !important; color: #92400e !important; }

.alert-icon { margin-right: 6px; }

/* ── Submit Button ──────────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.08s;
}

.btn-login:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(58, 125, 42, 0.28);
}

.btn-login:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Card Footer ────────────────────────────────────────────── */
.card-footer-area {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-security {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--gray-400);
}

.footer-security .bi-shield-check {
    color: var(--success);
    font-size: 13px;
}

.footer-copy {
    font-size: 12px;
    color: var(--gray-400);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    body {
        padding: 16px;
        align-items: flex-start;
        padding-top: 32px;
    }

    .card-brand   { padding: 20px 20px 18px; }
    .card-body-area { padding: 20px 20px 16px; }

    .card-footer-area {
        padding: 10px 20px;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* "Hesap oluştur" (klinik kurulum sihirbazına geçiş) */
.kayit-ayrac { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; font-size: 12px; color: var(--gray-500); }
.kayit-ayrac::before, .kayit-ayrac::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.btn-kayit {
    width: 100%; padding: 9px 20px; background: #ffffff; color: var(--primary);
    border: 1.5px solid var(--primary-xlight); border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.btn-kayit:hover { background: var(--primary-pale); border-color: var(--primary-light); color: var(--primary-dark); }
