/* project-root/public/system/assets/css/page/login.css */
/* Enthält das komplette Styling der Glas-Uhr + Login-Backside (vormals inline).
   FOUNDATION: Nur ändern, wenn Design wirklich zwingend angepasst werden muss. */

@property --primary-light-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: -75deg;
}

@property --dark-edge-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 105deg;
}

:root {
    --minute-marker-opacity: 1;
    --inner-shadow-opacity: 1;
    --outer-shadow-opacity: 1;
    --reflection-opacity: 0.5;
    --glossy-opacity: 0.3;
    --hour-number-opacity: 1;
    --hour-number-color: rgba(50, 50, 50, 0.9);
    --minute-marker-color: rgba(80, 80, 80, 0.5);
    --hand-color: rgba(50, 50, 50, 0.9);

    --accent-color: #4D81BE;
    --accent-rgb: 77, 129, 190;

    --second-hand-color: var(--accent-color);

    --shadow-layer1-opacity: 0.1;
    --shadow-layer2-opacity: 0.1;
    --shadow-layer3-opacity: 0.1;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #BBD4EF;
    font-family: "Inter", -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

.glass-clock-container {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    margin-top: clamp(0px, 2.2vh, 20px);
    perspective: 1200px;

    --clock-base: 350px;
    --safe-x: calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 24px);
    --safe-y: calc(env(safe-area-inset-top) + env(safe-area-inset-bottom) + 24px);

    --clock-scale: min(
        1,
        calc((100vw - var(--safe-x)) / var(--clock-base)),
        calc((100vh - var(--safe-y)) / var(--clock-base))
    );

    transform: translateZ(0) scale(var(--clock-scale));
    transform-origin: center center;
}

.flip-card {
    position: relative;
    width: 350px;
    height: 350px;
    transform-style: preserve-3d;
    transition: transform 800ms cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

.flip-card.flipped {
    transform: rotateY(180deg);
}

.glass-effect-wrapper {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 50%;
    background: transparent;
    pointer-events: auto;
    transition: all 400ms cubic-bezier(0.25, 1, 0.5, 1);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

.glass-effect-shadow {
    --shadow-offset: 3em;
    position: absolute;
    width: calc(100% + var(--shadow-offset));
    height: calc(100% + var(--shadow-offset));
    top: calc(0% - var(--shadow-offset) / 2);
    left: calc(0% - var(--shadow-offset) / 2);
    filter: blur(10px);
    -webkit-filter: blur(10px);
    pointer-events: none;
    z-index: 1;
    transition: all 400ms cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
}

.glass-effect-shadow::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    width: calc(100% - var(--shadow-offset) - 0.25em);
    height: calc(100% - var(--shadow-offset) - 0.25em);
    top: calc(var(--shadow-offset) - 0.5em);
    left: calc(var(--shadow-offset) - 0.875em);
    padding: 0.125em;
    box-sizing: border-box;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    overflow: visible;
    opacity: 0.8;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.05),
        0 15px 25px rgba(0, 0, 0, 0.05),
        0 20px 40px rgba(0, 0, 0, 0.05);
}

.glass-clock-face {
    --border-width: clamp(2px, 0.0625em, 4px);
    position: relative;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.03);
    background-image: linear-gradient(-75deg,
        rgba(255, 255, 255, 0.01),
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.01)
    );
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    box-shadow:
        inset 0 0.1em 0.1em rgba(0, 0, 0, 0.1),
        inset 0 -0.1em 0.1em rgba(255, 255, 255, 0.5),
        10px 5px 10px rgba(0, 0, 0, var(--shadow-layer1-opacity)),
        10px 20px 20px rgba(0, 0, 0, var(--shadow-layer2-opacity)),
        10px 55px 50px rgba(0, 0, 0, var(--shadow-layer3-opacity));
    z-index: 3;
    overflow: hidden;
    pointer-events: auto;
    user-select: none;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, box-shadow;
}

.glass-clock-face::after {
    content: "";
    position: absolute;
    z-index: 10;
    inset: 0;
    border-radius: 50%;
    width: calc(100% + var(--border-width));
    height: calc(100% + var(--border-width));
    top: calc(0% - var(--border-width) / 2);
    left: calc(0% - var(--border-width) / 2);
    padding: var(--border-width);
    box-sizing: border-box;
    background:
        conic-gradient(
            from var(--primary-light-angle) at 50% 50%,
            rgba(255, 255, 255, 1),
            rgba(255, 255, 255, 0.2) 5% 40%,
            rgba(255, 255, 255, 1) 50%,
            rgba(255, 255, 255, 0.2) 60% 95%,
            rgba(255, 255, 255, 1)
        ),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.5));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    box-shadow:
        inset 0 0 0 calc(var(--border-width) / 2) rgba(255, 255, 255, 0.9),
        0 0 12px rgba(255, 255, 255, 0.8);
    transition: all 400ms cubic-bezier(0.25, 1, 0.5, 1), --primary-light-angle 500ms ease;
    opacity: 0.9;
    will-change: background, box-shadow;
}

.glass-edge-highlight {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    top: 0;
    left: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    z-index: 8;
    pointer-events: none;
    opacity: 0.6;
}

.glass-edge-shadow {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    top: 0;
    left: 0;
    box-shadow:
        inset -5px 5px 15px rgba(0, 0, 0, 0.3),
        inset -8px 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 7;
    pointer-events: none;
    opacity: var(--inner-shadow-opacity);
}

.glass-dark-edge {
    position: absolute;
    z-index: 9;
    inset: 0;
    border-radius: 50%;
    width: calc(100% + var(--border-width));
    height: calc(100% + var(--border-width));
    top: calc(0% - var(--border-width) / 2);
    left: calc(0% - var(--border-width) / 2);
    padding: var(--border-width);
    box-sizing: border-box;
    background: conic-gradient(
        from var(--dark-edge-angle) at 50% 50%,
        rgba(0, 0, 0, 0.5),
        rgba(0, 0, 0, 0) 5% 40%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0) 60% 95%,
        rgba(0, 0, 0, 0.5)
    );
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    transition: all 400ms cubic-bezier(0.25, 1, 0.5, 1), --dark-edge-angle 500ms ease;
    box-shadow: inset 0 0 0 calc(var(--border-width) / 2) rgba(0, 0, 0, 0.2);
    opacity: var(--inner-shadow-opacity);
    will-change: background;
}

.glass-glossy-overlay {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    top: 0;
    left: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.7) 15%,
        rgba(255, 255, 255, 0.5) 25%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        rgba(255, 255, 255, 0.1) 100%
    );
    pointer-events: none;
    z-index: 6;
    mix-blend-mode: overlay;
    opacity: var(--glossy-opacity);
    filter: blur(10px);
}

.glass-reflection {
    position: absolute;
    width: 350px;
    height: 175px;
    top: 0;
    left: 0;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(255, 255, 255, 0.4) 40%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 175px 175px 0 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: soft-light;
    opacity: var(--reflection-opacity);
    filter: blur(10px);
}

.clock-center-blur {
    position: absolute;
    width: 36px;
    height: 36px;
    top: 157px;
    left: 157px;
    background-color: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 16;
    pointer-events: none;
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.4),
        inset 0 0 8px rgba(255, 255, 255, 0.6);
}

.clock-hour-marks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 14;
}

.minute-marker {
    position: absolute;
    width: 1px;
    height: 10px;
    background-color: rgba(80, 80, 80, 0.5);
    top: 10px;
    left: 175px;
    transform-origin: center 165px;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
    opacity: var(--minute-marker-opacity);
}

.clock-number {
    position: absolute;
    font-size: 16px;
    font-weight: 500;
    color: rgba(50, 50, 50, 0.9);
    text-align: center;
    width: 30px;
    height: 20px;
    line-height: 20px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
    z-index: 15;
    opacity: var(--hour-number-opacity);
    user-select: none;
    pointer-events: none;
}

.clock-date {
    position: absolute;
    font-size: 12px;
    font-weight: 500;
    color: rgba(50, 50, 50, 0.9);
    text-align: center;
    width: 140px;
    bottom: 115px;
    left: 105px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
    z-index: 15;
    user-select: none;
    pointer-events: none;
}

.clock-timezone {
    display: none;
}

.clock-hand {
    position: absolute;
    transform-origin: center bottom;
    bottom: 175px;
    left: 175px;
    z-index: 16;
    will-change: transform;
}

.hour-hand {
    width: 6px;
    height: 70px;
    background-color: rgba(50, 50, 50, 0.9);
    margin-left: -3px;
    border-radius: 3px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.minute-hand {
    width: 4px;
    height: 100px;
    background-color: rgba(50, 50, 50, 0.9);
    margin-left: -2px;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.clock-center-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--second-hand-color);
    border-radius: 50%;
    top: 169px;
    left: 169px;
    z-index: 17;
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4);
}

.second-hand-container {
    position: absolute;
    width: 2px;
    height: 120px;
    top: 55px;
    left: 174px;
    transform-origin: 1px 120px;
    z-index: 17;
    will-change: transform;
}

.second-hand {
    position: absolute;
    width: 2px;
    height: 120px;
    background-color: var(--second-hand-color);
    bottom: 0;
    left: 0;
    box-shadow: 0 0 5px rgba(var(--accent-rgb), 0.5);
}

.second-hand-counterweight {
    position: absolute;
    width: 6px;
    height: 14px;
    background-color: var(--second-hand-color);
    bottom: -14px;
    left: -2px;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 5px rgba(var(--accent-rgb), 0.5);
}

.second-hand-shadow {
    position: absolute;
    width: 2px;
    height: 120px;
    top: 55px;
    left: 174px;
    transform-origin: 1px 120px;
    z-index: 14;
    filter: blur(2px);
    opacity: 0.3;
    will-change: transform;
}

/* ---------------- LED Pixel-Laufschrift ---------------- */
.clock-led-marquee {
    position: absolute;
    top: 124px;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);

    width: 70%;
    height: 86px;

    padding: 0 12px;
    box-sizing: border-box;

    z-index: 13;
    pointer-events: none;
    overflow: hidden;

    opacity: 0.98;
    mix-blend-mode: normal;

    filter: contrast(180%) brightness(1.08);

    --led-scroll-dist: 900px;

    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,1) 14%,
        rgba(0,0,0,1) 86%,
        rgba(0,0,0,0) 100%
    );
    mask-image: linear-gradient(
        to right,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,1) 14%,
        rgba(0,0,0,1) 86%,
        rgba(0,0,0,0) 100%
    );

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.clock-led-svg {
    width: 100%;
    height: 100%;
    display: block;
    shape-rendering: crispEdges;
    text-rendering: geometricPrecision;
    image-rendering: pixelated;
}

.led-text {
    font-family: "Press Start 2P", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 40px;
    letter-spacing: 1px;
    word-spacing: 1px;
    fill: #fff;
    opacity: 1;
    text-transform: uppercase;
}

.led-text-move {
    transform-origin: 0 0;
    transform-box: fill-box;
    animation: ledScroll 20s steps(900) infinite;
    will-change: transform;
}

@keyframes ledScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(var(--led-scroll-dist) * -1)); }
}

/* BACK */
.clock-back {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.clock-back-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%,
        rgba(255, 255, 255, 0.85),
        rgba(240, 240, 240, 0.9) 40%,
        rgba(230, 230, 230, 0.95) 100%
    );
    box-shadow:
        inset 0 0.4em 0.8em rgba(0, 0, 0, 0.12),
        inset 0 -0.3em 0.6em rgba(255, 255, 255, 0.6),
        10px 20px 30px rgba(0, 0, 0, 0.10);
}

.login-form {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 24px;
    transform: translateZ(1px);
}

.login-fields {
    width: 90%;
    max-width: 280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}

.login-fields label {
    width: 100%;
    text-align: center;
    font-size: 12px;
    user-select: none;
}

.login-fields input {
    width: 90%;
    max-width: 260px;
    margin: 0 auto;
    text-align: center;
    display: block;
    padding: 10px;
    border: 1px gray solid;
    border-radius: 10px;
    outline: none;
    font-size: 16px;
}

.login-fields .password-wrap {
    position: relative;
    width: 98%;
    max-width: 280px;
    margin: 0 auto;
}

.login-fields .password-wrap input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
    text-align: center;
    padding: 10px;
    padding-right: 42px;
    border: 1px gray solid;
    border-radius: 10px;
    outline: none;
    font-size: 16px;
}

.pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);

    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    cursor: pointer;
    line-height: 0;

    /* etwas dunkler, damit es auf hellem Back sicher sichtbar ist */
    color: rgba(70, 70, 70, 0.85);

    opacity: 1 !important;
    visibility: visible !important;

    z-index: 3;
}

/* Firefox inner focus padding/border kill */
.pw-toggle::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.pw-toggle:hover,
.pw-toggle:focus,
.pw-toggle:active {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.pw-toggle svg {
    width: 22px;
    height: 22px;
    display: block;

    /* wichtig für Firefox */
    fill: currentColor;
    color: inherit;

    opacity: 1 !important;
    visibility: visible !important;

    pointer-events: none;
}

.pw-toggle svg path {
    fill: currentColor;
}

.login-actions {
    width: 70%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    align-items: stretch;
}

.btn-login {
    height: 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(108, 161, 222, 1), rgba(77, 129, 190, 1));
    color: #fff;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(var(--accent-rgb), 0.35);
}

.login-msg {
    min-height: 18px;
    font-size: 12px;
    text-align: center;
    color: rgba(120, 0, 0, 0.8);
}

.anmeldetitel {
    color: #4d81beff !important;
    text-align: center;
}
