/* ============================================================
   DEGITdok · Login
   Weißes Card-Layout mit rotierender animierter Brand-Border
   ============================================================ */

@property --grad-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

:root {
    --brand: #68c9f1;
    --brand-deep: #4099bd;
    --brand-darker: #2c7a99;
    --ink: #1a202c;
    --ink-soft: #4a5568;
}

* { box-sizing: border-box; }

body.login-page {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse 55% 50% at 50% 50%, rgba(255, 255, 255, 0.92), transparent 70%),
        radial-gradient(ellipse 55% 45% at 12% 18%, rgba(104, 201, 241, 0.32), transparent 60%),
        radial-gradient(ellipse 50% 40% at 88% 85%, rgba(104, 201, 241, 0.22), transparent 60%),
        linear-gradient(180deg, #e1f1fa 0%, #ffffff 65%, #ffffff 100%) !important;
    overflow-x: hidden;
}

.login-stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    position: relative;
}

/* ============================================================
   Rotierende Brand-Border um das gesamte Login-Fenster
   ============================================================ */
.login-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 2.5px;
    border-radius: 22px;
    /* Die rotierende Conic-Gradient als Hintergrund - durch das
       Padding entsteht aussen ein 2.5px-Ring, in dem die Animation
       sichtbar ist; das weiße Card-Element verdeckt die Mitte. */
    background: conic-gradient(
        from var(--grad-angle),
        rgba(104, 201, 241, 0.08) 0deg,
        rgba(104, 201, 241, 0.08) 55deg,
        var(--brand-deep) 70deg,
        var(--brand) 82deg,
        #ffffff 90deg,
        var(--brand) 98deg,
        var(--brand-deep) 110deg,
        rgba(104, 201, 241, 0.08) 125deg,
        rgba(104, 201, 241, 0.08) 360deg
    );
    animation:
        rotateBorder 4.5s linear infinite,
        wrapEntry 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Weicher Outer-Glow um den Rand herum, ebenfalls rotierend */
.login-wrap::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 30px;
    background: conic-gradient(
        from var(--grad-angle),
        transparent 0deg,
        transparent 55deg,
        rgba(104, 201, 241, 0.55) 80deg,
        rgba(255, 255, 255, 0.85) 90deg,
        rgba(104, 201, 241, 0.55) 100deg,
        transparent 125deg,
        transparent 360deg
    );
    filter: blur(14px);
    opacity: 0.6;
    z-index: -1;
    animation: rotateBorder 4.5s linear infinite;
    pointer-events: none;
}

@keyframes rotateBorder {
    to { --grad-angle: 360deg; }
}

@keyframes wrapEntry {
    from { opacity: 0; transform: translateY(15px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Eigentliche Login-Karte
   ============================================================ */
.login-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.8rem 2.8rem 2.5rem;
    box-shadow:
        0 1px 2px rgba(14, 26, 43, 0.04),
        0 8px 30px -8px rgba(14, 26, 43, 0.15),
        0 30px 70px -25px rgba(14, 26, 43, 0.25);
}

/* ============================================================
   Headline-Block (linksbündig)
   ============================================================ */
.login-head {
    margin-bottom: 1.8rem;
}

.eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    color: var(--brand-deep);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.eyebrow::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(64, 153, 189, 0.35), transparent);
}

.wordmark {
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin: 0;
    font-size: 2.9rem;
    display: inline-flex;
    align-items: baseline;
}
.logo-deg, .logo-dok { color: var(--ink); }
.logo-it             { color: var(--brand); }

.subtitle {
    margin: 0.65rem 0 0;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--brand-deep);
    text-transform: uppercase;
    font-weight: 600;
}

/* ============================================================
   Fehlermeldung
   ============================================================ */
.error-message {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #991b1b;
    font-size: 0.92rem;
    animation: errShake 0.5s ease-in-out;
}
.error-message i { font-size: 1.05rem; flex-shrink: 0; }
@keyframes errShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ============================================================
   Form (Underline-Style)
   ============================================================ */
.form-group { margin-bottom: 1.2rem; }

.form-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}
.form-label > i {
    color: var(--brand-deep);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.input-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.25s ease, transform 0.25s ease;
    z-index: 3;
}
.input-wrap:focus-within .input-icon {
    color: var(--brand);
    transform: translateY(-50%) translateX(2px);
}

.form-input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 2.7rem;
    border: none;
    border-bottom: 1.5px solid #e4e7ec;
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.3s ease, padding-left 0.3s ease;
}
.form-input::placeholder { color: #94a3b8; }
.form-input:focus {
    border-bottom-color: var(--brand);
    padding-left: 2.9rem;
}

/* ============================================================
   Submit-Button
   ============================================================ */
.login-button {
    width: 100%;
    margin-top: 1.6rem;
    padding: 1.05rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: white;
    border: none;
    border-radius: 11px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    box-shadow:
        0 10px 25px rgba(104, 201, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.25s ease;
}
.login-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 35px rgba(104, 201, 241, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.login-button:active {
    transform: translateY(0);
}

.button-text { flex: 1; text-align: center; }
.button-icon { font-size: 0.9rem; transition: transform 0.3s ease; }
.login-button:hover .button-icon { transform: translateX(5px); }

.login-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ============================================================
   Footer
   ============================================================ */
.login-footer {
    margin-top: 1.8rem;
    padding-top: 1.3rem;
    border-top: 1px solid #f1f3f6;
    text-align: center;
}
.footer-text {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(74, 85, 104, 0.55);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
    .login-stage { padding: 1.5rem 1rem; }
    .login-wrap { max-width: 100%; padding: 2px; }
    .login-card { padding: 2.2rem 1.8rem 2rem; border-radius: 18px; }
    .wordmark { font-size: 2.3rem; }
    .subtitle { font-size: 0.72rem; }
    .eyebrow { font-size: 0.66rem; }
}

@media (max-width: 380px) {
    .login-card { padding: 1.8rem 1.4rem; }
    .wordmark { font-size: 2rem; }
}

/* Reduced motion: Border-Animation entschaerfen */
@media (prefers-reduced-motion: reduce) {
    .login-wrap {
        animation: wrapEntry 0.4s ease-out both;
        background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
    }
    .login-wrap::before {
        animation: none;
        opacity: 0.3;
        background: var(--brand);
    }
}

/* Print */
@media print {
    body.login-page { background: white !important; }
    .login-wrap::before { display: none !important; }
    .login-wrap {
        background: white;
        animation: none;
        border: 1px solid #ccc;
    }
}
