/* ============================================================
   portal/assets/css/portal-auth.css
   Split-Screen-Login im App-Look (Referenz: app.jpg)
   ============================================================ */

body.p-auth {
    margin: 0;
    min-height: 100vh;
    background: #F4F6FA;
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: #3A434C;
    -webkit-font-smoothing: antialiased;
}

.p-auth__shell {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 100vh;
}

/* --- Bildseite --- */
.p-auth__aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px 46px;
    color: #fff;
    background: #16202B center/cover no-repeat;
    isolation: isolate;
}
.p-auth__aside::before {
    content: '';
    position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(160deg, rgba(12,22,32,.9) 0%, rgba(20,45,70,.66) 48%, rgba(12,22,32,.9) 100%);
}
.p-auth__brand { display: flex; align-items: center; gap: 12px; }
.p-auth__brand img { height: 40px; width: auto; }
.p-auth__brand-text { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.p-auth__brand-sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.62); font-weight: 600; }

.p-auth__hero { max-width: 460px; }
.p-auth__hero h1 {
    font-size: clamp(28px, 3.2vw, 46px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -.035em;
    margin: 0 0 14px;
    color: #fff;
}
.p-auth__hero p { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.82); margin: 0; }

.p-auth__features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.p-auth__feature {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    backdrop-filter: blur(6px);
    font-size: 11.5px; font-weight: 600;
}
.p-auth__feature i { font-size: 11px; color: #8FC3EA; }

.p-auth__foot { font-size: 11px; color: rgba(255,255,255,.5); }

/* --- Formularseite --- */
.p-auth__main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background:
        radial-gradient(90% 60% at 100% 0%, #EEF4FB 0%, transparent 62%),
        radial-gradient(70% 50% at 0% 100%, #F1F7FC 0%, transparent 60%),
        #F6F8FB;
}
.p-auth__card {
    width: 100%;
    max-width: 430px;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E8EDF3;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(28,33,37,.04), 0 30px 60px -40px rgba(28,33,37,.5);
    padding: 34px 32px;
}
.p-auth__logo-mobile { display: none; }
.p-auth__title { font-size: 24px; font-weight: 800; color: #1C2125; letter-spacing: -.03em; margin: 0; }
.p-auth__sub { font-size: 13px; color: #7A8794; margin: 5px 0 24px; }

.p-auth__form { display: flex; flex-direction: column; gap: 14px; }
.p-auth__form, .p-auth__form * { box-sizing: border-box; min-width: 0; }

.p-auth__field { display: flex; flex-direction: column; gap: 5px; }
.p-auth__label { font-size: 11.5px; font-weight: 700; color: #64707C; }
.p-auth__input-wrap { position: relative; }
.p-auth__input-wrap > i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 12.5px; color: #A8B2BD; pointer-events: none;
}
.p-auth__input {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    height: 46px;
    border: 1px solid #DFE6EF;
    border-radius: 12px;
    padding: 0 44px 0 41px;
    font-family: inherit;
    font-size: 13.5px;
    color: #1C2125;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.p-auth__input::placeholder { color: #A8B2BD; }
.p-auth__input:focus {
    outline: none;
    border-color: #B4CFE7;
    box-shadow: 0 0 0 4px rgba(46,119,184,.09);
}
.p-auth__eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: transparent; color: #A8B2BD; cursor: pointer;
}
.p-auth__eye:hover { background: #F4F7FB; color: #2E77B8; }

.p-auth__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.p-auth__check { display: inline-flex; align-items: center; gap: 7px; color: #5D6874; font-weight: 600; }
.p-auth__check input { accent-color: #2E77B8; width: 15px; height: 15px; }
.p-auth__link { color: #2E77B8; font-weight: 700; }
.p-auth__link:hover { color: #27629A; text-decoration: underline; }

.p-auth__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; height: 48px;
    border: 0; border-radius: 12px;
    background: #2E77B8; color: #fff;
    font-family: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px -14px rgba(46,119,184,.95);
    transition: background .16s, box-shadow .16s, transform .16s;
}
.p-auth__btn:hover { background: #27629A; }
.p-auth__btn:active { transform: translateY(1px); }

.p-auth__alert {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: 12.5px; font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.p-auth__alert i { margin-top: 1px; }
.p-auth__alert--err { background: #FEE2E2; border-color: #F7C9C9; color: #B91C1C; }
.p-auth__alert--ok  { background: #E0F2E1; border-color: #C7E7C8; color: #38843C; }

.p-auth__divider {
    display: flex; align-items: center; gap: 10px;
    margin: 20px 0;
    font-size: 11px; color: #A8B2BD; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
}
.p-auth__divider::before, .p-auth__divider::after {
    content: ''; flex: 1; height: 1px; background: #E8EDF3;
}

.p-auth__footlinks { text-align: center; font-size: 12.5px; color: #7A8794; }
.p-auth__footlinks a { color: #2E77B8; font-weight: 700; }
.p-auth__footlinks a:hover { text-decoration: underline; }

.p-auth__meta {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid #EFF3F8;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 11px; color: #A8B2BD;
}
.p-auth__meta a { color: #7A8794; font-weight: 600; }
.p-auth__meta a:hover { color: #2E77B8; }

/* ============================================================
   Kompatibilität für Tailwind-basierte Auth-Seiten
   (register.php, passwort-vergessen.php, passwort-zuruecksetzen.php)
   Aktiv, sobald body die Klasse `p-auth-legacy` trägt.
   ============================================================ */
body.p-auth-legacy {
    margin: 0;
    min-height: 100vh;
    padding: 32px 18px;
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: #3A434C;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(90% 60% at 100% 0%, #EEF4FB 0%, transparent 62%),
        radial-gradient(70% 50% at 0% 100%, #F1F7FC 0%, transparent 60%),
        #F4F6FA;
}
body.p-auth-legacy p-auth__center { display: flex; align-items: center; justify-content: center; }

.p-auth-legacy h1 {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #1C2125 !important;
    letter-spacing: -.03em;
    margin: 0 !important;
    line-height: 1.2;
}
.p-auth-legacy h2.text-sm {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .09em !important;
    text-transform: uppercase !important;
    color: #A8B2BD !important;
    margin-bottom: 12px !important;
}

/* Cards */
.p-auth-legacy .bg-white.rounded-2xl {
    background: #fff !important;
    border: 1px solid #E8EDF3 !important;
    border-radius: 18px !important;
    box-shadow: 0 2px 6px rgba(28,33,37,.04), 0 26px 50px -40px rgba(28,33,37,.5) !important;
    padding: 22px !important;
}
.p-auth-legacy .shadow-xl { box-shadow: 0 2px 6px rgba(28,33,37,.04), 0 26px 50px -40px rgba(28,33,37,.5) !important; }

/* Logo/Header */
.p-auth-legacy .text-center.mb-8 { margin-bottom: 22px !important; }
.p-auth-legacy img.h-12 { height: 42px !important; width: auto; margin: 0 auto 14px; }

/* Felder */
.p-auth-legacy label.block,
.p-auth-legacy label.text-sm {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #64707C !important;
    margin-bottom: 5px !important;
}
.p-auth-legacy input[type="text"],
.p-auth-legacy input[type="email"],
.p-auth-legacy input[type="password"],
.p-auth-legacy input[type="tel"],
.p-auth-legacy input[type="date"],
.p-auth-legacy input[type="number"],
.p-auth-legacy select,
.p-auth-legacy textarea {
    width: 100%;
    border: 1px solid #DFE6EF !important;
    border-radius: 12px !important;
    background: #fff !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    color: #1C2125 !important;
    padding: 11px 14px !important;
    min-height: 44px;
    transition: border-color .15s, box-shadow .15s;
}
.p-auth-legacy input.pl-11 { padding-left: 40px !important; }
.p-auth-legacy input:focus,
.p-auth-legacy select:focus,
.p-auth-legacy textarea:focus {
    outline: none !important;
    border-color: #B4CFE7 !important;
    box-shadow: 0 0 0 4px rgba(46,119,184,.09) !important;
}
.p-auth-legacy input[type="radio"], .p-auth-legacy input[type="checkbox"] { accent-color: #2E77B8; }

/* Buttons */
.p-auth-legacy button[type="submit"],
.p-auth-legacy .bg-primary {
    background: #2E77B8 !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    padding: 13px 18px !important;
    cursor: pointer;
    box-shadow: 0 12px 24px -16px rgba(46,119,184,.95);
    transition: background .16s;
}
.p-auth-legacy button[type="submit"]:hover,
.p-auth-legacy .bg-primary:hover { background: #27629A !important; }

/* Alerts */
.p-auth-legacy .bg-red-50 {
    background: #FEE2E2 !important;
    border-color: #F7C9C9 !important;
    color: #B91C1C !important;
    border-radius: 12px !important;
    font-size: 12.5px !important;
    font-weight: 600;
}
.p-auth-legacy .bg-green-50 {
    background: #E0F2E1 !important;
    border-color: #C7E7C8 !important;
    color: #38843C !important;
    border-radius: 12px !important;
    font-size: 12.5px !important;
    font-weight: 600;
}
.p-auth-legacy .space-y-6 > * + * { margin-top: 14px !important; }
.p-auth-legacy .space-y-5 > * + * { margin-top: 13px !important; }
.p-auth-legacy .space-y-4 > * + * { margin-top: 11px !important; }

/* Konto-Typ-Auswahl (peer-checked) */
.p-auth-legacy .peer:checked ~ div {
    border-color: #2E77B8 !important;
    background: #F1F7FC !important;
}
.p-auth-legacy .border-2.border-gray-200 { border-color: #E8EDF3 !important; border-radius: 12px !important; }

@media (max-width: 1023px) {
    .p-auth__shell { grid-template-columns: 1fr; }
    .p-auth__aside { display: none; }
    .p-auth__logo-mobile {
        display: flex; align-items: center; gap: 10px;
        justify-content: center; margin-bottom: 22px;
    }
    .p-auth__logo-mobile img { height: 34px; }
    .p-auth__main { min-height: 100vh; padding: 28px 18px; }
    .p-auth__card { padding: 26px 22px; border-radius: 18px; }
}

@media (max-width: 479px) {
    .p-auth__title { font-size: 21px; }
    .p-auth__input { height: 44px; font-size: 13px; }
    .p-auth__btn { height: 46px; }
}
