/* ── RESET & BASE ─ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-main: #020918;
    --bg-secondary: #061124;
    --bg-navy: #07152B;
    --card-bg: rgba(7, 21, 43, 0.65);
    --card-border: rgba(90, 107, 138, 0.35);
    --text-primary: #FFFFFF;
    --text-muted: #5A6B8A;
    --text-blue-grey: #7A8BA8;
    --input-bg: rgba(6, 17, 36, 0.8);
    --input-border: rgba(90, 107, 138, 0.4);
    --green-start: #2DE5A7;
    --green-end: #13D18D;
    --bright-blue: #258FEF;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { font-size: 16px; }
body {
    background: linear-gradient(160deg, var(--bg-main) 0%, var(--bg-secondary) 50%, var(--bg-navy) 100%);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ── DECORATIVE BACKGROUND CURVES ─ */
.bg-curve-top-left,
.bg-curve-bottom-right {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
    filter: blur(80px);
}

.bg-curve-top-left {
    top: -30%;
    left: -20%;
    width: 70vw;
    height: 70vw;
    max-width: 700px;
    max-height: 700px;
    background: radial-gradient(circle at center,
        rgba(10, 61, 124, 0.35) 0%,
        rgba(0, 191, 255, 0.12) 40%,
        transparent 70%);
}

.bg-curve-bottom-right {
    bottom: -25%;
    right: -15%;
    width: 60vw;
    height: 60vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle at center,
        rgba(0, 191, 255, 0.2) 0%,
        rgba(10, 61, 124, 0.15) 45%,
        transparent 70%);
}

/* ── WRAPPER: Fluid height adaptation ─ */
.login-wrapper {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 40px) clamp(16px, 4vw, 32px);
    gap: clamp(12px, 2vh, 32px);
}

/* ── BRAND SECTION ─ */
.brand-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1vh, 14px);
    flex-shrink: 0;
}

/* ✅ UPDATED: Canvas logo styling instead of SVG */
.skyline-s-logo {
    width: clamp(80px, 12vw, 140px);
    height: clamp(70px, 10vw, 120px);
    display: block;
    /* Canvas renders crisply at any DPR via JS scaling */
}

.company-name {
    font-size: clamp(32px, 5.5vw, 64px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    text-align: center;
}

.subtitle {
    font-size: clamp(13px, 2vw, 21px);
    font-weight: 500;
    color: var(--text-blue-grey);
    text-transform: uppercase;
    letter-spacing: clamp(3px, 0.8vw, 7px);
    text-align: center;
}

/* ── LOGIN CARD ─ */
.login-card {
    width: min(90%, 690px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: clamp(20px, 3vw, 30px);
    padding: clamp(20px, 3.5vw, 48px) clamp(20px, 4vw, 52px);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 40px rgba(2, 9, 24, 0.5);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 28px);
}

.welcome-heading {
    font-size: clamp(28px, 4.5vw, 54px);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.15;
}

.welcome-subtitle {
    font-size: clamp(16px, 2.5vw, 29px);
    color: var(--text-blue-grey);
    text-align: center;
    font-weight: 400;
    margin-top: clamp(-4px, -0.5vh, -8px);
}

/* ── GOOGLE BUTTON ─ */
.google-btn {
    width: 100%;
    height: clamp(56px, 7vh, 88px);
    background: rgba(26, 32, 48, 0.9);
    border: 1px solid rgba(90, 107, 138, 0.3);
    border-radius: clamp(12px, 2vw, 18px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.2vw, 14px);
    font-size: clamp(15px, 2.2vw, 22px);
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: var(--font-main);
}

.google-btn:hover { background: rgba(36, 44, 64, 0.95); }
.google-btn:active { transform: scale(0.98); }
.google-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.google-icon { flex-shrink: 0; }

/* ── DIVIDER ─ */
.divider {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.5vw, 20px);
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgba(90, 107, 138, 0.3);
}

.divider-text {
    font-size: clamp(14px, 1.8vw, 20px);
    color: var(--text-blue-grey);
    white-space: nowrap;
}

/* ── FORM FIELDS ─ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 0.8vh, 10px);
}

.field-label {
    font-size: clamp(15px, 2vw, 24px);
    font-weight: 600;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: clamp(10px, 1.5vw, 16px);
    height: clamp(52px, 6.5vh, 84px);
    transition: border-color 0.2s;
}

.input-wrapper:focus-within { border-color: var(--bright-blue); }
.input-wrapper.has-error { border-color: #FF5555; }

.input-icon {
    position: absolute;
    left: clamp(14px, 2vw, 22px);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: clamp(14px, 2vw, 20px);
    padding-left: clamp(44px, 5.5vw, 64px);
    padding-right: clamp(44px, 5.5vw, 64px);
}

.input-wrapper input::placeholder { color: var(--text-muted); }
.input-wrapper.has-toggle input { padding-right: clamp(44px, 5.5vw, 64px); }

.toggle-password {
    position: absolute;
    right: clamp(12px, 1.8vw, 20px);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-msg {
    display: block;
    font-size: clamp(12px, 1.4vw, 15px);
    color: #FF5555;
    min-height: clamp(14px, 1.8vh, 20px);
}

/* ── REMEMBER ME & FORGOT PASSWORD ROW ─ */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 12px);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-checkbox {
    width: clamp(24px, 3vw, 34px);
    height: clamp(24px, 3vw, 34px);
    min-width: clamp(24px, 3vw, 34px);
    background: rgba(6, 17, 36, 0.6);
    border: 1.5px solid rgba(90, 107, 138, 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remember-me input:checked + .custom-checkbox {
    background: var(--bright-blue);
    border-color: var(--bright-blue);
}

.remember-label {
    font-size: clamp(14px, 1.8vw, 21px);
    color: var(--text-blue-grey);
    white-space: nowrap;
}

.forgot-link {
    color: var(--bright-blue);
    font-size: clamp(14px, 1.8vw, 22px);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

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

/* ── PRIMARY BUTTON ─ */
.primary-btn {
    width: 100%;
    height: clamp(54px, 6.5vh, 86px);
    background: linear-gradient(135deg, var(--green-start), var(--green-end));
    border: none;
    border-radius: clamp(12px, 1.8vw, 17px);
    font-size: clamp(16px, 2.2vw, 24px);
    font-weight: 700;
    color: #020918;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    font-family: var(--font-main);
}

.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(45, 229, 167, 0.3); }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── SIGNUP PROMPT ─ */
.signup-prompt {
    text-align: center;
    font-size: clamp(14px, 1.8vw, 23px);
    color: var(--text-blue-grey);
}

.signup-prompt a {
    color: var(--green-start);
    text-decoration: none;
    font-weight: 600;
}

.signup-prompt a:hover { text-decoration: underline; }

/* ── FOOTER ─ */
.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.login-footer a {
    font-size: clamp(13px, 1.6vw, 21px);
    color: var(--text-blue-grey);
    text-decoration: none;
    font-weight: 400;
}

.login-footer a:hover { color: var(--text-primary); }
.footer-sep { color: rgba(90, 107, 138, 0.5); font-size: clamp(10px, 1.2vw, 16px); }

/* ── SHORT SCREEN ADAPTATION ─ */
@media (max-height: 700px) {
    .login-wrapper { gap: clamp(6px, 1vh, 12px); padding-top: 12px; padding-bottom: 12px; }
    .brand-section { gap: 4px; }
    .login-card { gap: clamp(8px, 1.2vh, 16px); padding: clamp(14px, 2vw, 24px); }
    .welcome-subtitle { margin-top: -2px; }
    .divider { margin: 0; }
    .options-row { gap: 8px; }
    .login-footer { gap: 8px; }
}

/* Ultra-short screens: allow scrolling rather than clipping */
@media (max-height: 550px) {
    .login-wrapper { min-height: auto; padding: 12px 16px; overflow-y: auto; }
}

/* ── SMALL MOBILE (< 360px) ─ */
@media (max-width: 359px) {
    .options-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .forgot-link { align-self: flex-end; }
                   }
