/* ==========================================================================
   Formularseiten: Anmeldung, Registrierung, Profil
   ==========================================================================
   Ergänzt index.css - Farben, Schrift und Radius kommen von dort, damit die
   Seiten nicht auseinanderlaufen, wenn dort ein Wert geändert wird. */

/* Bewusst .auth-card statt body: index.html lädt diese Datei ebenfalls (wegen
   .field/.alert/.submit im Zahlungs-Tab), und eine body-Regel würde dort die
   Ausrichtung des App-Containers mitverändern - eine Layout-Änderung an einer
   Seite, die mit Formularen nichts zu tun hat. */
.auth-card {
    align-self: flex-start;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.auth-card h1 {
    font-size: 22px;
    margin-bottom: 4px;
}

.auth-card .subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

/* Abschnittsüberschrift innerhalb eines längeren Formulars */
.section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 24px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--card-inner);
}

.section-title:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 16px;
}

.field {
    margin-bottom: 16px;
}

/* Zwei Felder nebeneinander, z.B. PLZ und Ort */
.field-row {
    display: flex;
    gap: 12px;
}

.field-row .field {
    flex: 1;
    min-width: 0;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field label .optional {
    opacity: 0.6;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--card-inner);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 15px;
}

.field textarea {
    resize: vertical;
    min-height: 72px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.field .hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
}

button.submit {
    width: 100%;
    padding: 13px;
    margin-top: 8px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

button.submit:disabled {
    opacity: 0.5;
    cursor: default;
}

button.secondary {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-family: var(--font-family);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.alert {
    display: none;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.alert.error {
    background: rgba(255, 59, 48, 0.15);
    color: var(--accent-red);
}

.alert.success {
    background: rgba(48, 209, 88, 0.15);
    color: var(--accent-green);
}

.auth-foot {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.auth-foot a {
    color: var(--accent-blue);
    text-decoration: none;
}

.auth-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.auth-head a {
    font-size: 13px;
    color: var(--accent-blue);
    text-decoration: none;
    white-space: nowrap;
}

/* Der Zahlungs-Tab nutzt dieselben Felder, liegt aber in einer .card der
   Hauptseite - dort darf .auth-card-Zentrierung nicht greifen. */
.tab-content .field label .optional {
    margin-left: 4px;
}

.tab-content button.submit {
    margin-top: 4px;
}

/* Kopfbereich des Zahlungs-Tabs: Belegnummer und Kunde nebeneinander mit
   dem Status, damit beim Quittieren klar ist, welcher Beleg gemeint ist. */
.payment-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-top: 12px;
    margin-bottom: 16px;
    border-top: 1px solid var(--card-inner);
}

.payment-label {
    font-size: 11px;
    color: var(--text-muted);
}

.payment-number {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.02em;
}

.payment-customer {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: pre-line;   /* Adresse mehrzeilig */
}

/* Aufklappmenue in der Kopfzeile ------------------------------------------ */
.menu { position: relative; }

.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.menu-items {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 150px;
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 6px;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.menu.open .menu-items { display: block; }

.menu-items a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-main);
    text-decoration: none;
}

.menu-items a:hover { background: var(--card-inner); }

/* Feldbezogene Fehlermeldung - steht direkt unter dem Eingabefeld, damit
   klar ist, welches gemeint ist. Der allgemeine .alert oben am Formular
   beantwortet die Frage "welches Feld?" nicht. */
.field-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #ff453a;
    line-height: 1.4;
}

.field input.invalid {
    border-color: #ff453a;
}

/* Bereitschaftsanzeige fuer die QR-Rechnung im Profil. */
.qr-status {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.qr-status.ready { color: #30d158; }
.qr-status.pending { color: var(--text-muted); }
