/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    /* Color Palette */
    --primary-color: #0056b3;       /* Seriöses Behörden-Blau */
    --primary-hover: #004494;
    --secondary-color: #f8f9fa;     /* Hintergrund Hell */
    --text-color: #333333;          /* Dunkelgrau für Lesbarkeit */
    --text-muted: #666666;
    --text-muted-footer: #f8f9fa;   /* Weißlich für Footer auf dunklem Grund */
    --border-color: #dee2e6;
    --success-color: #05055c;       /* Dunkelblau als Akzentfarbe */
    --danger-color: #dc3545;        /* Für Fehlermeldungen */
    --success-bg: #d4edda;          /* Für Erfolgsmeldungen Hintergrund */
    --success-text: #155724;        /* Für Erfolgsmeldungen Text */
    
    /* Header Gradient */
    --header-gradient-start:#05055c;
    --header-gradient-mid: #203a43;
    --header-gradient-end: #add8e6;
    
    /* Spacing & Layout */
    --container-width: 900px;
    --border-radius: 8px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    
    /* Font */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Input Styling */
    --input-height: 48px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--secondary-color); /* Hintergrund leicht grau für Kontrast zu weißen Cards */
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   HEADER (Unified for HTML & PHP)
   ========================================= */
/* Wir gruppieren .site-header (HTML) und .main-header (PHP) */
.site-header,
.main-header {
    background: linear-gradient(90deg, var(--header-gradient-start), var(--header-gradient-end));
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: white; /* Wichtig für PHP Text-Links */
}

/* Spezielles Styling für den PHP Text-Logo Link */
.main-header .logo {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-header .user-nav .chip {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.main-header .user-nav .chip:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* =========================================
   HEADER COMPONENTS (HTML Only)
   ========================================= */
.header-lang-selector {
    display: flex;
    gap: 0.5rem;
    order: 2; 
}

.header-lang-selector button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-family: var(--font-main);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.header-lang-selector button:hover,
.header-lang-selector button.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-1px);
}

.header-lang-selector .flag-icon { font-size: 1.2rem; line-height: 1; }
.header-lang-selector .lang-code { font-weight: 600; text-transform: uppercase; }

.logo-container { flex: 0 0 auto; }
.logo-container.left { order: 1; }
.logo-container.right { order: 3; }

.header-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* =========================================
   MAIN LAYOUT & CONTAINERS
   ========================================= */
/* .container (HTML) und .wrapper (PHP) */
.container,
.wrapper {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    flex: 1;
}

/* PHP Wrapper zentrieren für Login/Register Seiten */
.wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertikal mittig */
    align-items: center;     /* Horizontal mittig */
}

/* =========================================
   PHP / LEGACY PAGES SUPPORT (Forms & Auth)
   ========================================= */

/* Die "Karte" für Login/Registrierung */
.auth-container {
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 500px; /* Standardbreite für Login */
    margin-bottom: 2rem;
    border-top: 5px solid var(--success-color);
}

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

.auth-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Formulare */
.form-group {
    margin-bottom: 1.25rem;
    position: relative; /* Für Passwort-Toggle Icons */
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    height: var(--input-height);
    padding: 10px 15px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
    background-color: #fff;
}

/* Alerts (Fehler/Erfolg) in PHP */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    text-align: left;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #c3e6cb;
}

/* Passwort Toggle Icon */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 38px; /* Ungefähre Position basierend auf Label */
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
}

/* Footer Links in Formularen */
.form-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* =========================================
   BUTTONS (Unified)
   ========================================= */
.btn,
button[type="submit"] {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--success-color);
    color: white;
    padding: 0 2rem;
    height: var(--input-height);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%; /* In Formularen volle Breite */
}

.btn:hover,
button[type="submit"]:hover {
    background-color: #000040; /* Etwas dunkler */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--success-color);
    color: var(--success-color);
    margin-top: 10px;
}

.btn-outline:hover {
    background-color: var(--success-color);
    color: white;
}

/* =========================================
   CONTENT SECTIONS (Index.html)
   ========================================= */
.intro-content {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 5px;
}

.lead-text {
    font-size: 1.15rem;
    color: var(--text-muted);
}

/* Accordion */
.requirements-section { margin-bottom: 3rem; }
.accordion-wrapper { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-top: var(--spacing-md); }

details {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

details[open] { border-color: var(--primary-color); }

summary {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    font-weight: 600;
    background-color: #fafafa;
}
summary::-webkit-details-marker { display: none; }
summary:focus { outline: 2px solid var(--primary-color); outline-offset: -2px; }

summary .icon { margin-right: 10px; font-size: 1.2rem; }
summary .chevron { margin-left: auto; transition: transform 0.3s; font-size: 0.8rem; color: var(--text-muted); }
details[open] summary .chevron { transform: rotate(180deg); }

.details-content {
    padding: 1rem;
    background-color: white;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* CTA Section */
.cta-section {
    text-align: center;
    background-color: white; /* Weiß für besseren Kontrast auf grauem Body */
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--success-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* =========================================
   FOOTER (Unified)
   ========================================= */
.site-footer,
.main-footer {
    background: linear-gradient(90deg, var(--header-gradient-start), var(--header-gradient-end));
    border-top: none;
    padding: var(--spacing-lg) 0;
    margin-top: auto;
    color: var(--text-muted-footer);
    text-align: center;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav a,
.footer-links a {
    color: var(--text-muted-footer);
    margin-left: 1rem;
    text-decoration: none;
    opacity: 0.9;
}

.footer-nav a:hover,
.footer-links a:hover {
    text-decoration: underline;
    opacity: 1;
}

/* =========================================
   RESPONSIVE & HELPERS
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
    .site-header, .main-header {
        justify-content: center;
        padding: 10px;
    }
    
    .header-lang-selector {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }

    .logo-container.right { order: 2; margin-left: auto; }
    .header-logo { height: 40px; }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-nav a { margin: 0 0.5rem; }

    /* WICHTIG für regtenant.php: Überschreibt das Inline-Grid auf Mobile */
    .auth-container div[style*="display: grid"] {
        display: flex !important;
        flex-direction: column;
    }

/* =========================================
   FIXES FOR PWDRES.PHP & BUTTONS
   ========================================= */

/* Damit Buttons innerhalb des Footers ihre Button-Optik behalten */
.form-footer .btn {
    text-decoration: none !important; /* Kein Unterstreichen */
    color: var(--success-color);      /* Korrekte Button-Farbe erzwingen */
    width: auto;                      /* Nicht volle Breite, sondern kompakt */
    display: inline-flex;
    margin-top: 0;
}

.form-footer .btn:hover {
    color: white;                     /* Weiße Schrift beim Hover */
    background-color: var(--success-color);
}
/* =========================================
   FIX FOR ICON LINKS (pwforgot.php)
   ========================================= */
.form-footer a {
    display: inline-flex;       /* Icon und Text nebeneinander */
    align-items: center;        /* Vertikal zentriert */
    justify-content: center;
    gap: 0.5rem;               /* Abstand zwischen Pfeil und Text */
}

.form-footer .material-icons {
    font-size: 1.1rem !important; /* Icon-Größe passend zum Text */
    vertical-align: middle;
}
/* Styling für den Login-Button im Header (nur regtenant.php) */
.header-login-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.3s;
    border: 1px solid rgba(255,255,255,0.4);
    display: inline-flex;
    align-items: center;
    margin-left: 10px; /* Abstand zu den Flaggen */
}

.header-login-btn:hover {
    background-color: white;
    color: var(--primary-color);
}

}