/* ============================================================================
   SOUBOR: /www/hosting/saas-autoskola.cz/www/saas/css/auth.css
   POPIS: Centrální stylování pro SaaS Autoškolu (Verze 2026.3 - OPRAVA LAYOUTU)
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #ea580c;
    --primary-hover: #c2410c;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85); /* 85% neprůhledná bílá */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --input-bg: #f1f5f9;
    --input-border: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(30, 41, 59, 0.1);
    --text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* OPRAVA: Řadí prvky pod sebe a dovoluje jim roztáhnout se */
    color: var(--text-main);
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(30, 41, 59, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(30, 41, 59, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* VODOTISK NA POZADÍ */
body::before {
    content: var(--watermark-text, ''); 
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    font-size: 7vw;
    font-weight: 800;
    color: rgba(30, 41, 59, 0.02);
    white-space: nowrap;
    z-index: -1;
    pointer-events: none;
    user-select: none;
    text-transform: uppercase;
}

/* HLAVNÍ KONTEJNERY - PŘIHLAŠOVÁNÍ */
.login-box, .auth-container {
    background: var(--card-bg);
    width: 100%;
    max-width: 420px;
    padding: 45px 40px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    z-index: 10;
    margin: auto; /* OPRAVA: Dynamicky centruje login uprostřed obrazovky */
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* NADPISY */
h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
    text-shadow: var(--text-shadow);
    letter-spacing: -0.5px;
}

.description, .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* FORMULÁŘE */
.form-group { 
    margin-bottom: 24px; 
    text-align: left; 
}

.form-group label {
    display: block; 
    font-size: 0.75rem; 
    color: var(--text-muted);
    text-transform: uppercase; 
    margin-bottom: 8px; 
    font-weight: 700; 
    letter-spacing: 0.8px;
}

.form-control, input[type="email"], input[type="password"], input[type="text"], input[type="number"], .profile-input {
    width: 100%; 
    padding: 14px 16px; 
    background: var(--input-bg);
    border: 1px solid var(--input-border); 
    color: var(--text-main);
    border-radius: 12px; 
    font-size: 1rem; 
    outline: none; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.form-control:focus, input:focus, .profile-input:focus {
    background: #ffffff; 
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.1);
}

.readonly-input { background: #f1f5f9; color: #64748b; cursor: not-allowed; }
.readonly-input:focus { border-color: #cbd5e1; box-shadow: none; }

/* Ztmavení placeholderů (teček u hesel a předvyplněných textů) pro lepší čitelnost */
.form-control::placeholder, input::placeholder {
    color: #1e293b;
    opacity: 0.5;
}

/* WRAPPER PRO IKONY V INPUTECH */
.password-wrapper, .input-with-icon { 
    position: relative; 
}

.password-wrapper .toggle-password, .input-with-icon i:first-child {
    position: absolute; 
    right: 15px; 
    top: 50%; 
    transform: translateY(-50%);
    cursor: pointer; 
    color: var(--text-muted); 
    transition: color 0.2s; 
    font-size: 1.1rem;
    z-index: 5;
}

.password-wrapper .toggle-password:hover { 
    color: var(--primary-color); 
}

/* TLAČÍTKA */
.btn-submit, .btn-main, button[type="submit"] {
    width: 100%; 
    background: var(--primary-color); 
    color: white;
    border: none; 
    padding: 16px; 
    font-size: 1rem; 
    font-weight: 700;
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.2s ease;
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover, .btn-main:hover {
    background: var(--primary-hover); 
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(234, 88, 12, 0.25);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ZPRÁVY A CHYBY */
.message {
    padding: 16px; 
    border-radius: 12px; 
    margin-bottom: 25px;
    font-size: 0.9rem; 
    text-align: left; 
    display: flex; 
    align-items: center; 
    gap: 12px;
    line-height: 1.4;
    border: 1px solid transparent;
}

.message-error { 
    background: #fef2f2; 
    color: var(--error-color); 
    border-color: #fee2e2; 
}

.message-success { 
    background: #f0fdf4; 
    color: var(--success-color); 
    border-color: #dcfce7; 
}

/* ODKAZY */
.links-container { 
    margin-top: 35px; 
    font-size: 0.9rem; 
    color: var(--text-muted); 
    display: flex; 
    justify-content: center; 
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.links-container a { 
    color: var(--text-muted); 
    text-decoration: none; 
    font-weight: 600; 
    transition: all 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
}

.links-container a:hover { 
    color: var(--primary-color); 
}

.links-separator { 
    opacity: 0.3; 
}

/* PIN KÓD */
.pin-container { 
    display: flex; 
    justify-content: center; 
    gap: 14px; 
    margin: 25px 0; 
}

.pin-box { 
    width: 60px; 
    height: 70px; 
    text-align: center; 
    font-size: 2rem; 
    font-weight: 800; 
    border-radius: 14px; 
    border: 2px solid var(--input-border);
}

.pin-box:focus { 
    border-color: var(--primary-color); 
    transform: translateY(-4px); 
}

/* LOGO A IKONY */
.auth-logo-wrapper { 
    margin-bottom: 35px; 
}

.auth-icon-large { 
    font-size: 4rem; 
    color: var(--primary-color); 
    margin-bottom: 25px; 
    display: block;
}

/* ============================================================================
   KOMPLETNÍ PROFIL - FORMULÁŘ (Roztažení a zarovnání)
   ============================================================================ */
.profile-container { 
    width: 100%; /* OPRAVA: Nutí kontejner roztáhnout se */
    max-width: 850px; 
    margin: 40px auto; /* OPRAVA: Vycentruje profil horizontálně s mezerou nahoře i dole */
    padding: 0 20px; 
    z-index: 10;
}

.profile-box { 
    background: var(--card-bg); 
    width: 100%;
    padding: 40px; 
    border-radius: 20px; 
    box-shadow: var(--shadow-md); 
    margin-bottom: 30px; 
}

.box-title { 
    font-size: 1.4rem; 
    font-weight: 800;
    color: var(--text-main); 
    margin-bottom: 30px; 
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-color); 
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.form-group.full { 
    grid-column: 1 / -1; 
    position: relative; 
}

.name-grid { 
    display: grid; 
    grid-template-columns: 100px 1fr 1fr; 
    gap: 20px; 
}

.secure-badge { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    background: #f0fdf4; 
    border: 1px solid #bbf7d0; 
    padding: 15px; 
    border-radius: 12px; 
    color: #166534; 
    margin-bottom: 30px; 
}

.group-card { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    background: var(--bg-color); 
    border: 1px solid var(--input-border); 
    padding: 16px; 
    border-radius: 14px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
}

.group-card:hover { 
    border-color: var(--primary-color); 
    background: #fff;
}

.group-card:has(input:checked) { 
    background: #fff7ed; 
    border-color: var(--primary-color); 
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.1);
}

.checkbox-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
    gap: 12px; 
    margin-top: 10px; 
}

/* Profilová tlačítka dole */
.buttons-wrap { 
    display: flex; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-top: 20px;
}

.btn-action { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    padding: 16px 24px; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.2s; 
    border: none; 
    text-decoration: none; 
    font-size: 1rem; 
}

.btn-draft { 
    background: var(--input-bg); 
    color: var(--text-muted); 
    border: 1px solid var(--input-border); 
    flex: 1; 
}
.btn-draft:hover { 
    background: #e2e8f0; 
    color: var(--text-main); 
}

.btn-complete { 
    background: var(--primary-color); 
    color: white; 
    flex: 2; 
}
.btn-complete:hover { 
    background: var(--primary-hover); 
}

.btn-logout { 
    background: #fff; 
    color: var(--error-color); 
    border: 1px solid #fecaca; 
}
.btn-logout:hover { 
    background: #fef2f2; 
}

/* Modální okno GDPR */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); display: none; justify-content: center; align-items: center; z-index: 9999; backdrop-filter: blur(4px); }
.modal-content { background: white; padding: 40px; border-radius: 20px; width: 90%; max-width: 600px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 20px; margin-bottom: 25px; }
.modal-title { font-size: 1.4rem; font-weight: 800; color: #1e293b; margin: 0; display: flex; align-items: center;}
.close-modal-btn { background: var(--input-bg); border: none; font-size: 1.5rem; color: #64748b; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.close-modal-btn:hover { background: #e2e8f0; color: #1e293b;}
.modal-body { color: #334155; line-height: 1.6; font-size: 0.95rem; }
.modal-footer { margin-top: 30px; text-align: right; border-top: 1px solid #e2e8f0; padding-top: 20px; }
.gdpr-link { color: var(--primary-color); text-decoration: underline; cursor: pointer; font-weight: bold; }

/* Našeptávač Nominatim */
.autocomplete-list { position: absolute; z-index: 1000; background: white; border: 1px solid #cbd5e1; width: 100%; max-height: 200px; overflow-y: auto; display: none; border-radius: 0 0 12px 12px; box-shadow: var(--shadow-md); top: 100%; }
.autocomplete-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }
.autocomplete-item:hover { background: var(--input-bg); color: var(--primary-color); }

/* RESPONZIVITA */
@media (max-width: 600px) {
    .form-grid, .name-grid { grid-template-columns: 1fr; }
    .buttons-wrap { flex-direction: column; }
    .btn-action { width: 100%; }
}
/* Záchranné lano pro mobilní prohlížeče (oprava mizejícího pozadí) */
@media (max-width: 768px) {
    body {
        /* Vynutíme zrušení 'fixed' na mobilech. Používáme !important pro přebití PHP inline stylů */
        background-attachment: scroll !important; 
        background-position: center top !important;
        background-size: cover !important;
    }
}

@media (max-width: 480px) {
    .login-box, .auth-container {
        padding: 35px 25px;
        /* Vrátíme formuláři trochu dýchacího prostoru, ať nezalehne pozadí */
        max-width: 92%; 
        margin: 20px auto !important; 
        border-radius: 16px !important;
    }
    .pin-box { width: 50px; height: 60px; }
    .profile-box { padding: 25px 20px; }
}
/* KONEC SOUBORU: auth.css */