@import url("https://fonts.googleapis.com/css2?family=Fleur+De+Leah&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Princess+Sofia&display=swap');

/* ── Reset ─────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Body ──────────────────────────────────────────── */
body {
    min-height: 100vh;
    background: linear-gradient(to bottom, #0f0036, #4b0082);
    font-family: "Comic Sans MS", "Poppins", sans-serif;
    overflow-x: hidden;
    /* Centre the scene vertically + horizontally on desktop */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Page wrapper ──────────────────────────────────── */
.page {
    position: relative;
    width: 820px;
    max-width: 98vw;
    height: 600px;
}

/* ── Bear ──────────────────────────────────────────── */
.bear {
    position: absolute;
    left: -20px;
    bottom: 0;
    width: 400px;
    z-index: 3;
    pointer-events: none;
}

/* ── Masha ─────────────────────────────────────────── */
.masha {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    z-index: 3;
    pointer-events: none;
}

/* ── Login card ─────────────────────────────────────  */
.login-container {
    position: absolute;
    left: 260px;
    top: 50%;
    transform: translateY(-50%);
    width: 470px;
    background: #d7bde2;
    border: 2px solid rgba(0, 255, 180, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 180, 0.7), 0 20px 40px rgba(0,0,0,0.15);
    padding: 36px 32px;
    border-radius: 20px;
    text-align: center;
    z-index: 4;          /* card in front of bear */
    animation: pop 0.7s ease forwards;
}

/* pop must carry translateY(-50%) so centering isn't lost */
@keyframes pop {
    from { transform: translateY(-50%) scale(0.85); opacity: 0; }
    to   { transform: translateY(-50%) scale(1);    opacity: 1; }
}

/* ── Titles ─────────────────────────────────────────── */
.st {
    color: rgba(0,0,0,0.73);
    font-family: "Fleur De Leah", cursive;
    font-size: clamp(48px, 9vw, 90px);
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.1;
}

.wl {
    color: rgb(130, 2, 130);
    font-family: "Princess Sofia", cursive;
    font-size: clamp(18px, 4vw, 28px);
    font-weight: bolder;
    margin-bottom: 8px;
}

.subtitle {
    color: #031e96;
    font-size: clamp(13px, 2.5vw, 16px);
    margin-bottom: 16px;
}

/* ── Form elements ──────────────────────────────────── */
label {
    display: block;
    text-align: left;
    font-size: clamp(14px, 2.5vw, 17px);
    margin: 8px 0 4px;
    color: #323131;
}

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid #d8d8d8;
    outline: none;
    font-size: clamp(13px, 2vw, 15px);
    box-shadow: 0 0 3px 2px cyan;
    background: #fff;
}

input:focus {
    border-color: rgb(0, 225, 255);
    box-shadow: 0 0 5px 3px cyan;
}

.forgot-password {
    text-align: right;
    margin-top: 4px;
    font-size: 13px;
}

/* ── Buttons ─────────────────────────────────────────── */
.login-btn {
    margin-top: 18px;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(to right, #1105ee, #0ef1a987);
    box-shadow: 0 0 5px cyan;
    color: #000;
    font-size: clamp(14px, 2vw, 16px);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
    min-height: 48px;
}

.login-btn:hover {
    background-color: #4f8cff;
    transform: translateY(-2px) scale(1.03);
}

button:hover {
    box-shadow: 0 0 5px cyan, 0 0 10px cyan, 0 0 10px rgb(0,0,0);
}

/* ── Divider ──────────────────────────────────────────── */
.divider {
    margin: 12px 0 8px;
    font-size: 12px;
    color: #d71313;
    font-weight: bold;
}

/* ── Google Sign-In wrapper ──────────────────────────── */
#g_id_signin {
    display: flex;
    justify-content: center;
    margin: 0 auto 4px;
}

/* ── Footer text ──────────────────────────────────────── */
.footer-text {
    margin-top: 14px;
    font-size: clamp(13px, 3vw, 18px);
    color: #ed1ed1d6;
}

.footer-text span {
    color: #430bbb;
    font-weight: bold;
    cursor: pointer;
    font-size: clamp(13px, 2.5vw, 15px);
}

a {
    color: #fa4002;
    text-decoration: none;
}

a:hover {
    color: #0048cf;
}

/* ── Message box ────────────────────────────────────── */
#log-msg {
    margin-bottom: 12px;
    font-size: 14px;
    padding: 10px;
    border-radius: 10px;
    display: none;
    text-align: center;
    min-height: 38px;
}

.login-success {
    background-color: #d4edda;
    color: #07e53b;
    border: 1px solid #c3e6cb;
    box-shadow: 0 0 25px #d595fa, 0 0 50px rgba(224,170,255,0.7);
    display: block !important;
}

.login-error {
    background-color: #f8d7da;
    color: #6b010b;
    border: 1px solid #f5c6cb;
    box-shadow: 0 0 25px #cc83f6, 0 0 50px rgba(224,170,255,0.7);
    display: block !important;
}

/* ── Bubbles ──────────────────────────────────────────── */
.bubbles {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bubbles span {
    position: absolute;
    bottom: -120px;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255,255,255,0.4);
    backdrop-filter: blur(2px);
    animation: bubbleRise linear infinite;
}

.bubbles span:nth-child(odd)  { width: 14px; height: 14px; }
.bubbles span:nth-child(3n)   { width: 26px; height: 26px; }
.bubbles span:nth-child(5n)   { width: 32px; height: 32px; }

.bubbles span:nth-child(1)  { left: 5%;  animation-duration: 9s;  animation-delay: 0s; }
.bubbles span:nth-child(2)  { left: 15%; animation-duration: 7s;  animation-delay: 2s; }
.bubbles span:nth-child(3)  { left: 25%; animation-duration: 11s; animation-delay: 1s; }
.bubbles span:nth-child(4)  { left: 35%; animation-duration: 8s;  animation-delay: 3s; }
.bubbles span:nth-child(5)  { left: 45%; animation-duration: 10s; animation-delay: 0s; }
.bubbles span:nth-child(6)  { left: 55%; animation-duration: 12s; animation-delay: 4s; }
.bubbles span:nth-child(7)  { left: 65%; animation-duration: 9s;  animation-delay: 1s; }
.bubbles span:nth-child(8)  { left: 75%; animation-duration: 7s;  animation-delay: 2s; }
.bubbles span:nth-child(9)  { left: 85%; animation-duration: 10s; animation-delay: 3s; }
.bubbles span:nth-child(10) { left: 95%; animation-duration: 12s; animation-delay: 1s; }
.bubbles span:nth-child(11) { left: 12%; animation-duration: 13s; animation-delay: 2s; }
.bubbles span:nth-child(12) { left: 28%; animation-duration: 9s;  animation-delay: 4s; }
.bubbles span:nth-child(13) { left: 42%; animation-duration: 11s; animation-delay: 1s; }
.bubbles span:nth-child(14) { left: 58%; animation-duration: 8s;  animation-delay: 3s; }
.bubbles span:nth-child(15) { left: 72%; animation-duration: 10s; animation-delay: 0s; }
.bubbles span:nth-child(16) { left: 88%; animation-duration: 12s; animation-delay: 4s; }
.bubbles span:nth-child(17) { left: 33%; animation-duration: 7s;  animation-delay: 1s; }
.bubbles span:nth-child(18) { left: 67%; animation-duration: 9s;  animation-delay: 2s; }
.bubbles span:nth-child(19) { left: 49%; animation-duration: 11s; animation-delay: 3s; }
.bubbles span:nth-child(20) { left: 81%; animation-duration: 13s; animation-delay: 1s; }

@keyframes bubbleRise {
    0%   { transform: translateY(0) scale(1);    opacity: 0.6; }
    50%  { transform: translateY(-50vh) scale(1.2); opacity: 1; }
    100% { transform: translateY(-120vh) scale(1.4); opacity: 0; }
}

/* ════════════════════════════════════════════════════
   DESKTOP — hide scrollbar, bear visible
════════════════════════════════════════════════════ */
@media (min-width: 769px) {
    html, body { height: 100vh; overflow: hidden; }
}

/* ════════════════════════════════════════════════════
   TABLET  ≤992px
════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    .page {
        width: 98vw;
        height: 560px;
    }

    .bear {
        left: -20px;
        width: 360px;
    }

    .login-container {
        left: 200px;
        width: 430px;
        padding: 28px 22px;
    }
}

/* ════════════════════════════════════════════════════
   MOBILE  ≤768px — card centred, bear hidden
════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    html, body {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body {
        padding: 0;
        display: block;
        min-height: 100vh;
    }

    .page {
        height: auto;
        overflow: visible;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 24px 16px 40px;
    }

    /* Bear hidden on mobile */
    .bear { display: none; }

    /* Card becomes full-width centred block */
    .login-container {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        padding: 32px 24px;
        border-radius: 18px;
        transform: none;
    }

    .st  { font-size: clamp(42px, 13vw, 68px); }
    .wl  { font-size: clamp(16px, 5vw, 24px); }

    input  { padding: 13px 14px; }

    .login-btn {
        padding: 14px;
        font-size: 15px;
    }
}

/* ════════════════════════════════════════════════════
   SMALL MOBILE  ≤480px
════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .page {
        padding: 20px 12px 36px;
    }

    .login-container {
        padding: 26px 18px;
        border-radius: 16px;
    }

    .st  { font-size: clamp(38px, 13vw, 58px); }
    .wl  { font-size: clamp(15px, 5vw, 22px); }

    input  { padding: 12px 12px; font-size: 14px; }

    .login-btn { padding: 13px; font-size: 14px; }

    .footer-text { font-size: 14px; }
}

/* ════════════════════════════════════════════════════
   VERY SMALL  ≤360px
════════════════════════════════════════════════════ */
@media (max-width: 360px) {
    .page { padding: 16px 10px 30px; }

    .login-container {
        padding: 22px 14px;
        border-radius: 14px;
    }

    .st  { font-size: 38px; }
    .wl  { font-size: 15px; }

    input       { padding: 11px 10px; }
    .login-btn  { padding: 12px; }

    .footer-text { font-size: 13px; }
}

/* ── Login loader overlay ──────────────────────────── */
.login-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    color: white;
    font-size: 18px;
}

.loader-spinner {
    width: 50px; height: 50px;
    border: 5px solid #fff;
    border-top: 5px solid #ff9800;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
