/* ================================================================
   HMS - Login Page Stylesheet
   Healthcare Blue & White Theme
   Compatible: IE8+, Chrome, Firefox, Safari (VS 2008 era & modern)
   ================================================================ */

/* ---------- Google Fonts Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    background-color: #EBF4FF;
    color: #1a2e4a;
}

/* ---------- Background ---------- */
body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a3d6b 0%, #1565C0 45%, #1E88E5 75%, #42A5F5 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Decorative background blobs */
body::before {
    content: '';
    position: fixed;
    top: -120px;
    right: -120px;
    width: 420px;
    height: 420px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -100px;
    left: -100px;
    width: 360px;
    height: 360px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
    width: 100%;
    max-width: 480px;
    z-index: 10;
}

/* ---------- Header Branding ---------- */
.brand-header {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeSlideDown 0.6s ease both;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 18px;
    margin-bottom: 14px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.brand-logo svg {
    width: 38px;
    height: 38px;
}

.brand-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.brand-subtitle {
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* ---------- Login Card ---------- */
.login-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 44px 40px 36px;
    box-shadow:
        0 32px 64px rgba(10, 61, 107, 0.28),
        0 8px 24px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fadeSlideUp 0.65s ease both;
    animation-delay: 0.1s;
    position: relative;
    overflow: hidden;
    /* Clips the top accent bar perfectly to the card's rounded corners */
}

/* Top accent bar */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1565C0, #42A5F5, #00BCD4);
}

/* ---------- Card Header ---------- */
.card-header {
    margin-bottom: 32px;
}

.card-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0a3d6b;
    letter-spacing: -0.3px;
}

.card-desc {
    font-size: 0.875rem;
    color: #5a7a9a;
    margin-top: 5px;
    font-weight: 400;
}

/* ---------- Alert / Status Message Panel ---------- */
.alert-panel {
    display: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.855rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    animation: fadeIn 0.3s ease;
}

.alert-panel.error {
    background: #FFF3F3;
    border: 1px solid #FFCDD2;
    color: #C62828;
}

.alert-panel.success {
    background: #F1F8E9;
    border: 1px solid #C5E1A5;
    color: #2E7D32;
}

.alert-panel.hidden {
    display: none !important;
}

/* ---------- Form Groups ---------- */
.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.form-label .required-mark {
    color: #E53935;
    margin-left: 2px;
}

/* Input wrapper for icon positioning */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #90AAC0;
    pointer-events: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

/* Text / Password Inputs */
.form-control {
    width: 100%;
    padding: 13px 44px 13px 44px;
    border: 1.8px solid #D0E4F5;
    border-radius: 10px;
    font-size: 0.935rem;
    font-family: inherit;
    color: #1a2e4a;
    background: #F7FBFF;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: #1565C0;
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(21, 101, 192, 0.14);
}

.form-control:focus+.input-focus-line,
.input-wrapper:focus-within .input-icon {
    color: #1565C0;
}

.form-control::placeholder {
    color: #B0C4D8;
    font-weight: 300;
}

/* Toggle password visibility button */
.toggle-password {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #90AAC0;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.toggle-password:hover {
    color: #1565C0;
}

/* ---------- Login Button ---------- */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #1565C0 0%, #1E88E5 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 4px 18px rgba(21, 101, 192, 0.38);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.3s ease;
    border-radius: 10px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(21, 101, 192, 0.45);
    background: linear-gradient(135deg, #0d47a1 0%, #1565C0 100%);
}

.btn-login:active {
    transform: translateY(0px);
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.35);
}

.btn-login:disabled,
.btn-login.loading {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

/* Spinner inside button */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-login.loading .btn-spinner {
    display: block;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-icon {
    display: none;
}

/* ---------- Card Footer ---------- */
.card-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #EEF5FC;
    text-align: center;
}

.footer-note {
    font-size: 0.78rem;
    color: #8AAABB;
    line-height: 1.5;
}

/* ---------- Page Footer ---------- */
.page-footer {
    margin-top: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.76rem;
    letter-spacing: 0.3px;
    animation: fadeSlideUp 0.7s ease both;
    animation-delay: 0.25s;
}

/* ---------- Keyframes ---------- */
@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---------- Shake Animation (on auth error) ---------- */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    18% {
        transform: translateX(-7px);
    }

    36% {
        transform: translateX(7px);
    }

    54% {
        transform: translateX(-4px);
    }

    72% {
        transform: translateX(4px);
    }

    90% {
        transform: translateX(-2px);
    }
}

.shake {
    animation: shake 0.45s ease;
}

/* ---------- Responsive / Mobile ---------- */
@media (max-width: 520px) {
    .login-card {
        padding: 34px 24px 28px;
        border-radius: 16px;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .brand-title {
        font-size: 1.35rem;
    }

    .btn-login {
        padding: 13px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 28px 18px 24px;
    }
}