@import url("https://fonts.googleapis.com/css2?family=Pacifico&display=swap");

html {
    width: 100%;
    max-width: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Root container */

.login-page {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: calc(100vh - 7rem);
    box-sizing: border-box;
    overflow-x: clip;
}

/* Background glow and texture */

.login-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.9;
    filter: blur(2px);
    animation-name: login-overlay-pan;
    animation-duration: 32s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    overflow: hidden;
}

@keyframes login-overlay-pan {
    0% {
        transform: translate3d(0, 0, 0) scale(1.02);
    }

    50% {
        transform: translate3d(0, -12px, 0) scale(1.03);
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1.02);
    }
}

/* Shell to constrain width */

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Card – GLASSMORPHIC */

.login-card {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: 1.5rem;
    padding-top: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 1.2rem;
    padding-left: 1.25rem;
    box-sizing: border-box;
    overflow: hidden;

    border-width: 1px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.16);

    background-color: rgba(15, 23, 42, 0.45);
    background-image: radial-gradient(
        circle at 0% 0%,
        rgba(148, 163, 184, 0.35),
        transparent 55%
    );
    backdrop-filter: blur(28px) saturate(140%);

    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.92);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    color: #e5e7eb;
}

/* Subtle inner glow */

.login-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background-image:
        radial-gradient(
            circle at 0% 0%,
            rgba(255, 255, 255, 0.28),
            transparent 55%
        ),
        radial-gradient(
            circle at 100% 100%,
            rgba(129, 140, 248, 0.24),
            transparent 55%
        );
    opacity: 0.7;
    mix-blend-mode: screen;
    pointer-events: none;
}

/* Ensure content sits above glow */

.login-card > * {
    position: relative;
    z-index: 1;
    min-width: 0;
}

/* Header */

.login-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
}

/* Fancy script title */

.login-title {
    margin: 0;
    font-family: "Pacifico",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 1.9rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #f9fafb;
    text-shadow:
        0 0 16px rgba(248, 250, 252, 0.7),
        0 0 28px rgba(251, 191, 36, 0.8);
    word-break: break-word;
}

.login-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #cbd5f5;
    word-break: break-word;
}

/* Errors */

.alert {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    border-radius: 0.8rem;
    padding-top: 0.65rem;
    padding-right: 0.75rem;
    padding-bottom: 0.65rem;
    padding-left: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.alert.error {
    background-color: rgba(248, 113, 113, 0.12);
    border-width: 1px;
    border-style: solid;
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.alert.error ul {
    margin: 0;
    padding-left: 1.1rem;
}

.alert.error li {
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

/* Form layout */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    min-width: 0;
}

/* Form rows */

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
    min-width: 0;
}

.form-row.inline-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Labels */

.form-row label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e5e7eb;
    word-break: break-word;
}

/* Inputs */

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 0.75rem;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(148, 163, 184, 0.6);
    background-color: rgba(15, 23, 42, 0.9);
    padding-top: 0.6rem;
    padding-right: 0.75rem;
    padding-bottom: 0.6rem;
    padding-left: 0.75rem;
    font-size: 0.9rem;
    color: #e5e7eb;
    outline: none;
    transition-property: border-color,
        box-shadow,
        background-color,
        transform;
    transition-duration: 140ms;
    transition-timing-function: ease-out;
}

.login-form input[type="email"]::placeholder,
.login-form input[type="password"]::placeholder,
.login-form input[type="text"]::placeholder {
    color: #64748b;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus,
.login-form input[type="text"]:focus {
    border-color: rgba(56, 189, 248, 0.9);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.8),
        0 18px 40px rgba(15, 23, 42, 0.9);
    background-color: rgba(15, 23, 42, 0.96);
    transform: translateY(-1px);
}

/* Checkbox row */

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #cbd5f5;
    max-width: 100%;
    flex-wrap: wrap;
}

.checkbox-label input[type="checkbox"] {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 auto;
    border-radius: 0.3rem;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.95);
}

/* Forgot password */

.forgot-link {
    min-width: 0;
}

.forgot-link a {
    font-size: 0.8rem;
    color: #60a5fa;
    text-decoration: none;
    word-break: break-word;
}

.forgot-link a:hover {
    text-decoration: underline;
}

/* Label tag for OTP */

.label-tag {
    display: inline-flex;
    margin-left: 0.4rem;
    padding-top: 0.05rem;
    padding-right: 0.45rem;
    padding-bottom: 0.05rem;
    padding-left: 0.45rem;
    border-radius: 999px;
    background-color: rgba(30, 64, 175, 0.7);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #dbeafe;
    max-width: 100%;
}

/* Actions */

.form-actions {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

/* Buttons */

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.6rem;
    padding-right: 1rem;
    padding-bottom: 0.6rem;
    padding-left: 1rem;
    border-radius: 999px;
    border-width: 0;
    border-style: none;
    background-image: radial-gradient(
        circle at 0% 0%,
        rgba(56, 189, 248, 0.7),
        rgba(37, 99, 235, 1)
    );
    color: #0b1220;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 20px 45px rgba(37, 99, 235, 0.9);
    transition-property: transform,
        box-shadow,
        filter;
    transition-duration: 130ms;
    transition-timing-function: ease-out;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 26px 60px rgba(30, 64, 175, 0.95);
    filter: brightness(1.03);
}

.primary-button:active {
    transform: translateY(0);
    box-shadow: 0 16px 40px rgba(30, 64, 175, 0.9);
}

.primary-button.full-width {
    width: 100%;
    max-width: 100%;
}

/* Secondary button */

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.55rem;
    padding-right: 1rem;
    padding-bottom: 0.55rem;
    padding-left: 1rem;
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.9);
    transition-property: border-color,
        background-color,
        box-shadow,
        transform;
    transition-duration: 130ms;
    transition-timing-function: ease-out;
}

.secondary-button:hover {
    border-color: rgba(56, 189, 248, 0.9);
    background-color: rgba(15, 23, 42, 0.98);
    transform: translateY(-1px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.98);
}

.secondary-button.full-width {
    width: 100%;
    max-width: 100%;
}

/* Divider */

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: #94a3b8;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    min-width: 0;
    height: 1px;
    background-image: linear-gradient(
        to right,
        rgba(148, 163, 184, 0.1),
        rgba(148, 163, 184, 0.6),
        rgba(148, 163, 184, 0.1)
    );
}

/* Helper text */

.field-help {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 0.2rem;
    overflow-wrap: anywhere;
}

.field-help.center {
    text-align: center;
}

.field-help.small {
    font-size: 0.75rem;
}

/* Footer */

.login-footer {
    margin-top: 0.5rem;
    padding-top: 0.6rem;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: rgba(30, 64, 175, 0.7);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.login-footer-text {
    margin: 0;
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
    overflow-wrap: anywhere;
}

.login-footer-text a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
}

.login-footer-text a:hover {
    text-decoration: underline;
}

/* Small state helpers */

.button-loading {
    opacity: 0.85;
    cursor: progress;
}

/* Responsive tweaks */

@media (max-width: 640px) {
    .login-page {
        padding-top: 0.85rem;
        padding-bottom: 1rem;
        min-height: calc(100vh - 5rem);
    }

    .login-shell {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    .login-card {
        padding-top: 1.05rem;
        padding-right: 1rem;
        padding-bottom: 1.05rem;
        padding-left: 1rem;
        border-radius: 1.2rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .form-row.inline-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .forgot-link {
        align-self: stretch;
        text-align: left;
    }

    .label-tag {
        margin-left: 0;
        margin-top: 0.3rem;
    }

    .login-form input[type="email"],
    .login-form input[type="password"],
    .login-form input[type="text"] {
        font-size: 16px;
    }
}