@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg:        #f0f4f8;
    --surface:   #ffffff;
    --surface2:  #f5f7fa;
    --border:    #dce3ee;
    --accent:    #0284c7;
    --accent2:   #7c3aed;
    --accent3:   #059669;
    --text:      #0f172a;
    --muted:     #64748b;
    --danger:    #dc2626;
    --warn:      #d97706;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Body ── */
body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* ── Grid background ── */
#squareBackground {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(2, 132, 199, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(2, 132, 199, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Ambient glow orb */
body::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Containers ── */
.login-container,
.register-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 24px 20px;
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Card ── */
.login-card,
.register-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 38px 36px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}

/* top accent line */
.login-card::before,
.register-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ── Header ── */
.login-header,
.register-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1:first-child,
.register-header h1:first-child {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.login-header h1:last-child,
.register-header h1:last-child {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.register-header p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
}

/* ── Form Groups ── */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

/* ── Inputs ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
    font-weight: 300;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
    background: #ffffff;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select option {
    background: var(--surface);
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ── Password wrapper ── */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
    user-select: none;
    transition: color 0.2s;
    line-height: 1;
}

.toggle-password:hover {
    color: var(--accent);
}

/* ── Two-column row ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── Primary Button ── */
.btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #0369a1);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    opacity: 0.9;
}

/* ── Outline Button ── */
.btn-outline {
    padding: 8px 16px;
    border-radius: 7px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
    background: var(--accent);
    color: #ffffff;
}

/* ── Alerts ── */
.alert {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 22px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.alert.error {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #b91c1c;
}

.alert.success {
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.25);
    color: #065f46;
}

.alert.info {
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.25);
    color: var(--accent);
}

/* ── Forgot password ── */
.forgot-footer {
    text-align: right;
    margin-top: 6px;
    padding-bottom: 16px;
    font-size: 12px;
}

.forgot-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.forgot-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ── Card Footer (links) ── */
.login-footer,
.register-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.login-footer a,
.register-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.login-footer a:hover,
.register-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ── Divider ── */
.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Password Strength ── */
.password-strength {
    margin-top: 7px;
    height: 3px;
    border-radius: 4px;
    background: var(--surface2);
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.35s, background 0.35s;
}

.strength-weak   { width: 33%;  background: var(--danger); }
.strength-medium { width: 66%;  background: var(--warn); }
.strength-strong { width: 100%; background: var(--accent3); }

.strength-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
    letter-spacing: 0.3px;
}

/* ── Page Footer ── */
.footer {
    position: fixed;
    bottom: 14px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    z-index: 1;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .login-card,
    .register-card {
        padding: 28px 22px;
    }

    .login-header h1:last-child,
    .register-header h1:last-child {
        font-size: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════
   LOGIN PAGE  –  Centered container layout
   ═══════════════════════════════════════════ */

/* Override body for login page only */
body.login-page {
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f6ff 50%, #e0f7fa 100%);
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: auto !important;
    flex-wrap: nowrap !important;
}

/* Centered wrapper */
.login-wrapper {
    width: 100%;
    padding: 24px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* The floating card container */
.login-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 860px;
    min-height: 520px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(10, 42, 110, 0.18),
        0 4px 16px rgba(10, 42, 110, 0.08);
    animation: lbFadeUp 0.5s ease both;
}

@keyframes lbFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── LEFT PANEL ── */
.lp-left {
    position: relative;
    background: linear-gradient(135deg, #0a1f6b 0%, #0d3ba8 50%, #0a7ea4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 30px;
}

/* Animated dot grid overlay */
.lp-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(0,180,216,0.18) 1px, transparent 1px);
    background-size: 36px 36px;
    animation: gridDrift 20s linear infinite;
    pointer-events: none;
}
@keyframes gridDrift {
    0%   { background-position: 0 0; }
    100% { background-position: 36px 36px; }
}

/* Glowing orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(55px);
    opacity: 0.35;
    animation: orbPulse 6s ease-in-out infinite alternate;
    pointer-events: none;
}
.orb-1 { width: 260px; height: 260px; top: -60px;   left: -60px;  background: #00b4d8; animation-delay: 0s; }
.orb-2 { width: 200px; height: 200px; bottom: -50px; right: -50px; background: #06d6a0; animation-delay: 2s; }
.orb-3 { width: 150px; height: 150px; top: 45%;      right: 10px;  background: #4361ee; animation-delay: 4s; }
@keyframes orbPulse {
    from { transform: scale(1);    opacity: 0.28; }
    to   { transform: scale(1.18); opacity: 0.45; }
}

/* Logo wrapper */
.logo-wrap {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Chip SVG */
.chip-svg {
    width: 150px;
    height: 150px;
    margin-bottom: 22px;
    filter: drop-shadow(0 0 20px rgba(0,180,216,0.7));
    animation: chipFloat 4s ease-in-out infinite;
}
@keyframes chipFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-9px); }
}

.logo-title {
    font-size: 38px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0 0 28px rgba(0,180,216,0.55);
}
.logo-sub {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.68);
    margin-top: 9px;
}
.lp-badge {
    display: inline-block;
    margin-top: 22px;
    padding: 6px 18px;
    border-radius: 50px;
    border: 1px solid rgba(0,180,216,0.45);
    background: rgba(0,180,216,0.12);
    color: #7fdfff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ── RIGHT PANEL ── */
.lp-right {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 38px;
    overflow-y: auto;
}

.lp-form-header {
    margin-bottom: 28px;
}
.lp-form-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: #0a2a6e;
    line-height: 1.2;
}
.lp-form-header h1 span {
    color: #1565d8;
}
.lp-form-header p {
    font-size: 13px;
    color: #5a7099;
    margin-top: 5px;
}

/* Toggle show/hide button */
.toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #1565d8;
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.5px;
    padding: 0;
}
.toggle-btn:hover { color: #0a2a6e; }

/* Forgot password row */
.forgot-row {
    text-align: right;
    margin-top: 7px;
}
.forgot-row a {
    font-size: 12px;
    font-weight: 600;
    color: #1565d8;
    text-decoration: none;
    transition: opacity 0.2s;
}
.forgot-row a:hover { opacity: 0.75; text-decoration: underline; }

/* Login button */
.btn-login {
    width: 100%;
    padding: 13px;
    margin-top: 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #1148b8, #0a2a6e);
    color: #fff;
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(17,72,184,0.38);
}
.btn-login:active { transform: translateY(0); }

/* Register link */
.register-link {
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: #5a7099;
}
.register-link a {
    color: #1565d8;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}
.register-link a:hover { opacity: 0.75; text-decoration: underline; }

/* ── Two-column password row on register page ── */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── Register box: slightly taller to fit 5 fields ── */
.reg-box {
    max-width: 900px;
}
.reg-box .lp-right {
    padding: 32px 36px;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE  –  Mobile-first breakpoints
   Works for: phones, tablets, laptops, desktops
   ══════════════════════════════════════════════════ */

/* ── Large tablets / small laptops (≤ 900px) ── */
@media (max-width: 900px) {
    .login-box,
    .reg-box {
        max-width: 680px;
    }
    .logo-title { font-size: 32px; }
    .chip-svg   { width: 130px; height: 130px; }
}

/* ── Tablets / large phones landscape (≤ 700px) ── */
@media (max-width: 700px) {
    body.login-page {
        align-items: flex-start !important;
    }

    .login-wrapper {
        align-items: flex-start;
        padding: 20px 14px 40px;
        min-height: auto;
    }

    /* Stack panels vertically */
    .login-box,
    .reg-box {
        grid-template-columns: 1fr;
        max-width: 460px;
        border-radius: 16px;
        min-height: auto;
        width: 100%;
    }

    /* Left panel becomes a compact header */
    .lp-left {
        padding: 32px 24px;
        min-height: 200px;
        border-radius: 0;
    }
    .chip-svg   { width: 90px;  height: 90px;  }
    .logo-title { font-size: 26px; }
    .logo-sub   { font-size: 10px; letter-spacing: 2px; }
    .lp-badge   { margin-top: 14px; font-size: 10px; padding: 5px 14px; }

    /* Right panel */
    .lp-right {
        padding: 28px 22px !important;
    }
    .lp-form-header { margin-bottom: 20px; }
    .lp-form-header h1 { font-size: 20px; }

    /* Register: stack the two password fields */
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ── Small phones (≤ 420px) ── */
@media (max-width: 420px) {
    .login-wrapper {
        padding: 12px 10px 30px;
    }
    .login-box,
    .reg-box {
        border-radius: 12px;
    }
    .lp-left {
        padding: 24px 18px;
        min-height: 180px;
    }
    .chip-svg   { width: 72px; height: 72px; }
    .logo-title { font-size: 22px; }
    .lp-right   { padding: 22px 16px !important; }
    .lp-form-header h1 { font-size: 18px; }
    .btn-login  { font-size: 14px; padding: 12px; }

    /* Make inputs more thumb-friendly */
    input[type="email"],
    input[type="password"],
    input[type="text"] {
        padding: 13px 12px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }
}