/* login.css — responsive shared login / kiosk styling */

:root {
    --primary-blue: #0000cd;
    --page-bg: #f9f9f9;
    --text-dark: #111827;
    --input-border: #9ca3af;
    --input-focus: #0000cd;
    --card-bg: rgba(255, 255, 255, 0.92);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.14);
    --radius-md: 10px;
    --radius-lg: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--page-bg);
    color: var(--primary-blue);
    overflow-x: hidden;
}

/* Headline */
.welcome-text {
    font-family: 'Times New Roman', Times, serif;
    font-size: clamp(26px, 4vw, 35px);
    font-weight: bold;
    margin: 40px auto 20px auto;
    text-align: center;
    padding: 0 16px;
    line-height: 1.15;
    max-width: 1100px;
    overflow-wrap: break-word;
}

/* Main two-panel layout */
.login-layout {
    display: flex;
    justify-content: center;
    align-items: stretch;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 16px;
}

.left-panel,
.right-panel {
    flex: 1 1 0;
    padding: 20px;
    min-width: 0;
}

.left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.right-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.right-panel h1 {
    margin-top: 0;
    margin-bottom: 22px;
    font-size: clamp(26px, 4vw, 36px);
}

/* Divider */
.vertical-divider {
    width: 2px;
    background-color: var(--primary-blue);
    min-height: 300px;
    align-self: stretch;
    animation: expandHeight 1.4s ease-out forwards;
}

/* Logo */
.logo {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
    animation: spinFadeLogo 2.4s ease-in-out forwards;
    transform-style: preserve-3d;
    opacity: 0;
}

/* Forms */
form {
    width: 100%;
}

label {
    color: black;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 4px;
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"] {
    padding: 13px 12px;
    margin: 8px 0 14px 0;
    width: 100%;
    max-width: 360px;
    min-height: 48px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: rgba(255, 255, 255, 0.96);
    color: #000000;
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(0, 0, 205, 0.14);
}

/* Buttons */
.submit-container {
    display: block;
    width: 100%;
    max-width: 360px;
}

input[type="submit"],
button,
.button {
    touch-action: manipulation;
}

input[type="submit"] {
    padding: 16px 18px;
    background-color: white;
    color: var(--primary-blue);
    border: none;
    cursor: pointer;
    font-weight: bold;
    border-radius: 8px;
    font-size: clamp(18px, 3vw, 22px);
    width: 100%;
    max-width: 360px;
    transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 54px;
    box-shadow: var(--shadow-soft);
}

input[type="submit"]:hover {
    background-color: #f3f4f6;
}

input[type="submit"]:active {
    transform: scale(0.99);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
}

.horizontal-divider {
    width: 0%;
    height: 5px;
    background-color: var(--primary-blue);
    margin: 10px auto 30px auto;
    animation: expandWidth 1.4s ease-out forwards;
    max-width: 900px;
}

/* Animations */
@keyframes expandWidth {
    from {
        width: 0%;
    }

    to {
        width: 80%;
    }
}

@keyframes expandHeight {
    from {
        transform: scaleY(0);
        transform-origin: top;
    }

    to {
        transform: scaleY(1);
        transform-origin: top;
    }
}

@keyframes spinFadeLogo {
    0% {
        transform: rotateY(0deg);
        opacity: 0;
    }

    100% {
        transform: rotateY(1080deg);
        opacity: 1;
    }
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade-in targets */
h1,
h2,
h3,
label,
.welcome-text,
form,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="submit"] {
    animation: fadeInText 1.2s ease-in-out forwards;
    opacity: 0;
}

/* Set PIN container */
.container {
    margin: 80px auto 40px auto;
    padding: 24px 18px;
    width: min(100% - 28px, 560px);
    max-width: 560px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.container h2,
.container h3 {
    line-height: 1.25;
}

.welcome {
    font-family: 'Times New Roman', Times, serif;
    font-size: clamp(28px, 4vw, 35px);
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary-blue);
    line-height: 1.15;
    overflow-wrap: break-word;
}

.submit {
    margin-top: 20px;
}

/* Logout button */
.logout-button {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 100;
}

.logout-img {
    width: 60px;
    height: 60px;
    cursor: pointer;
}

/* Demo credential card compatibility */
.demo-login-card {
    width: 100%;
}

/* ---------------- Tablet ---------------- */
@media (max-width: 900px) {
    .welcome-text {
        margin-top: 28px;
        margin-bottom: 16px;
    }

    .login-layout {
        padding: 26px 16px;
        gap: 12px;
    }

    .left-panel,
    .right-panel {
        padding: 16px;
    }

    .vertical-divider {
        min-height: 260px;
    }

    .logo {
        max-width: 260px;
    }
}

/* ---------------- Phone Layout ---------------- */
@media (max-width: 768px) {
    body {
        min-height: 100svh;
    }

    .welcome-text {
        margin-top: 64px;
        margin-bottom: 14px;
        padding: 0 14px;
    }

    .horizontal-divider {
        height: 3px;
        margin: 8px auto 14px auto;
    }

    .login-layout {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px 28px 14px;
        gap: 10px;
    }

    .left-panel,
    .right-panel {
        width: 100%;
        padding: 10px;
    }

    .right-panel {
        align-items: stretch;
    }

    .right-panel h1 {
        text-align: center;
        margin: 8px 0 18px 0;
    }

    /* Turn the vertical divider into a horizontal divider */
    .vertical-divider {
        width: 100%;
        height: 2px !important;
        min-height: 2px;
        animation: none;
    }

    .logo {
        max-width: 210px;
        margin-top: 4px;
    }

    form,
    .submit-container,
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="email"],
    input[type="submit"] {
        width: 100%;
        max-width: none;
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="email"] {
        min-height: 50px;
        font-size: 16px;
        margin-bottom: 12px;
    }

    input[type="submit"] {
        min-height: 54px;
        padding: 14px;
    }

    .container {
        margin: 72px auto 28px auto;
        width: calc(100% - 24px);
        padding: 20px 14px;
    }

    .logout-img {
        width: 50px;
        height: 50px;
    }
}

/* ---------------- Small Phones ---------------- */
@media (max-width: 480px) {
    .welcome-text {
        font-size: 24px;
        line-height: 1.12;
    }

    .welcome {
        font-size: 27px;
    }

    .login-layout {
        padding-left: 10px;
        padding-right: 10px;
    }

    .left-panel,
    .right-panel {
        padding: 8px;
    }

    .logo {
        max-width: 185px;
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="email"] {
        padding: 12px;
    }

    input[type="submit"] {
        font-size: 18px;
        padding: 14px;
    }

    .logout-button {
        top: 8px;
        right: 8px;
    }

    .logout-img {
        width: 45px;
        height: 45px;
    }
}

/* ---------------- Very Narrow Screens ---------------- */
@media (max-width: 360px) {
    .welcome-text {
        font-size: 22px;
    }

    .welcome {
        font-size: 24px;
    }

    .logo {
        max-width: 160px;
    }

    .demo-login-card .demo-credential-line {
        flex-direction: column;
        gap: 2px;
    }
}

/* ---------------- Landscape Phones ---------------- */
@media (max-height: 520px) and (orientation: landscape) {
    .welcome-text {
        margin-top: 54px;
        font-size: 22px;
    }

    .login-layout {
        padding-top: 8px;
        padding-bottom: 16px;
    }

    .logo {
        max-width: 150px;
    }

    .container {
        margin-top: 58px;
    }
}

/* ---------------- Reduced Motion ---------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .logo,
    h1,
    h2,
    h3,
    label,
    .welcome-text,
    form,
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="email"],
    input[type="submit"] {
        opacity: 1 !important;
        transform: none !important;
    }
}
