/* =========================================
   1. BACKGROUND
   ========================================= */
body {
    background: url("/assets/cert_theme/images/nmu.jpg") no-repeat center center fixed !important;
    background-size: cover !important;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 20, 40, 0.8), rgba(20, 50, 100, 0.7));
    backdrop-filter: blur(5px);
    z-index: 0;
}

/* =========================================
   1.5 TOP NAVBAR (Bigger, so the site logo is visible)
   ========================================= */
.navbar {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
    min-height: 90px;
}

.navbar-brand {
    display: flex !important;
    align-items: center;
}

.navbar-brand img {
    height: 55px !important;
    max-height: 55px !important;
    width: auto !important;
}

/* =========================================
   2. LAYOUT STABILITY (The Fix)
   ========================================= */
/* Frappe wraps the page in <main class="container my-4">; that Bootstrap
   margin is extra height we don't account for below and was the real
   source of the page-wide scrollbar, so drop it on login-style pages only */
main:has(.for-login),
main:has(.for-forgot),
main:has(.for-signup),
main:has(.for-email-login),
main:has(.for-login-with-email-link) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Instead of centering vertically (which causes jumps), we align to the top */
.for-login,
.for-forgot,
.for-signup,
.for-email-login,
.for-login-with-email-link {
    display: flex;
    justify-content: center;
    /* This stops the vertical jumping: */
    align-items: flex-start !important;
    /* This sets the fixed position from the top: */
    padding-top: 70px !important;
    padding-bottom: 40px !important;
    /* Account for the navbar above so we don't add a page-wide scrollbar */
    min-height: calc(100vh - 90px);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* =========================================
   3. THE CARD (Adaptive Height)
   ========================================= */
.page-card {
    position: relative !important;

    /* Remove fixed height so it fits the content nicely */
    height: auto !important;
    min-height: 0 !important;

    /* Padding: Top is larger to fit the logo */
    padding: 80px 40px 40px 40px !important;
    width: 400px;
    margin: 0 auto !important; /* Remove vertical margins */

    background: rgba(18, 32, 60, 0.75) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* =========================================
   4. LOGO (Pinned to Card Top)
   ========================================= */
/* Hide the original logo container */
.page-card-head {
    display: none !important;
}

/* Re-draw logo attached to the card frame */
.page-card::before {
    content: "";
    position: absolute;
    top: -65px;
    left: 50%;
    transform: translateX(-50%);

    width: 130px;
    height: 130px;
    padding: 14px;
    box-sizing: border-box;

    background-image:
        url("/assets/cert_theme/images/logo.png"),
        radial-gradient(circle at 35% 28%, #ffffff 0%, #f3e9da 70%, #ecdcc2 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: center center, center center;
    background-size: 72%, cover;

    border-radius: 50%;
    border: 3px solid #ffffff;

    /* Crimson + gold rings, echoing the NMU crest, plus a warm glow */
    box-shadow:
        0 0 0 4px #8f1a24,
        0 0 0 7px #c9a227,
        0 18px 34px rgba(0, 0, 0, 0.45),
        0 0 28px rgba(143, 26, 36, 0.55);
    z-index: 10;
}

/* =========================================
   5. INPUTS
   ========================================= */
.form-group label {
    color: #e0e6ed !important;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-control {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 10px !important;
    height: 48px; /* Slightly smaller for compactness */
    color: #ffffff !important;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: #c9a227 !important;
    box-shadow: 0 0 15px rgba(201, 162, 39, 0.4);
}

.field-icon {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* =========================================
   6. BUTTONS & LINKS
   ========================================= */
.btn-primary {
    background: linear-gradient(135deg, #a3232e, #7a1620) !important;
    border: 1px solid rgba(201, 162, 39, 0.5);
    border-radius: 10px;
    height: 48px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 100%;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(122, 22, 32, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(122, 22, 32, 0.7);
}

.forgot-password-message, .sign-up-message {
    margin-top: 15px;
}

.forgot-password-message a,
.sign-up-message a {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 13px;
    text-decoration: none;
}

.forgot-password-message a:hover {
    color: #fff !important;
    text-decoration: underline;
}

footer {
    display: none !important;
}
