:root {
    --primary: #0B1929;
    --primary-light: #162A45;
    --accent: #5A9FD4;
    --accent-hover: #4588BE;
    --accent-glow: rgba(90, 159, 212, 0.35);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text: #FFF9F0;
    --text-muted: #9DBDD8;
    --border: rgba(90, 159, 212, 0.18);
    --card-bg: rgba(22, 42, 69, 0.6);
    --glass: rgba(255, 249, 240, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--primary);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Loading Screen ─── */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo-img {
    height: 72px;
    width: auto;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8EC5E8);
    width: 0;
    animation: loading 1.5s ease-out forwards;
}

@keyframes loading {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ─── Background Effects ─── */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 80%;
    filter: blur(90px);
    opacity: 0.75;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #5A9FD4, #0B1929);
    top: -200px;
    right: -200px;
    animation: float 20s ease-in-out infinite;
}

.orb-2 {
    width: 600px;
    height: 400px;
    background: linear-gradient(135deg, #0B1929, #3B9FE8);
    bottom: -100px;
    left: -100px;
    animation: float 25s ease-in-out infinite reverse;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #7DC8F8, #4AA8E8);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 15s ease-in-out infinite;
    opacity: 0.4;
}

/* ... Grid Pattern ... */
.grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(59, 159, 232, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 159, 232, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

/* ─── Header ─── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(11, 25, 41, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 82px;
    width: auto;
}

.header-buttons {
    display: flex;
    gap: 1rem;
}

/* ─── Buttons ─── */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: rgba(90, 159, 212, 0.15);
    color: var(--accent);
    border: 1.5px solid var(--accent);
    backdrop-filter: blur(10px);
}

.btn-primary:hover {
    background: rgba(90, 159, 212, 0.25);
    border-color: #8EC5E8;
    color: #8EC5E8;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--accent-glow);
}

.btn-secondary {
    background: rgba(90, 159, 212, 0.1);
    color: var(--text);
    border: 1.5px solid var(--border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(90, 159, 212, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    color: var(--text);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Main Content ─── */
.main-content {
    position: relative;
    z-index: 2;
}

/* ─── Hero ─── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease 0.1s backwards;
}

.hero h1 span {
    background: linear-gradient(135deg, #5AAEE0, #8EC5E8, #E8DDD0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.3s backwards;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s ease 0.5s backwards;
}

/* ─── Dashboard Preview ─── */
.dashboard-preview {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.dashboard-preview:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.dashboard-header {
    padding: 1rem 1.5rem;
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red    { background: #EF4444; }
.dot-yellow { background: #F59E0B; }
.dot-green  { background: #10B981; }

.dashboard-content {
    padding: 1.5rem;
}

.dashboard-stat {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-card:nth-child(1) .stat-card-value { color: var(--accent); }
.stat-card:nth-child(2) .stat-card-value { color: var(--success); }
.stat-card:nth-child(3) .stat-card-value { color: var(--warning); }

.dashboard-chart {
    height: 100px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 0.5rem;
    background: var(--glass);
    border-radius: 8px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #2E6FA8, #7DBDE3);
    border-radius: 4px 4px 0 0;
    animation: growBar 1s ease forwards;
    transform-origin: bottom;
}

@keyframes growBar {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Modals ─── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(22, 42, 69, 0.95);
    border: 1.5px solid var(--accent);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal.wide {
    max-width: 700px;
}

.modal-header {
    padding: 2rem 2rem 0;
    text-align: center;
}

.modal-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
}

.modal-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.modal-body {
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 40px; height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--text);
    background: var(--border);
}

/* ─── Registration Type Toggle ─── */
.registration-type-toggle {
    margin: 0 2rem 1.5rem;
    padding: 0.5rem;
    background: var(--glass);
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.reg-type-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-family: 'Outfit', sans-serif;
}

.reg-type-btn svg {
    margin-bottom: 0.25rem;
}

.reg-type-btn:hover {
    background: var(--glass);
    border-color: var(--border);
}

.reg-type-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ─── GPS Banner ─── */
.gps-banner {
    margin: 0 2rem 1.5rem;
    padding: 1rem;
    background: rgba(90, 159, 212, 0.1);
    border: 1px solid var(--accent);
    border-radius: 12px;
    display: none;
}

.gps-banner.show { display: block; }

.gps-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gps-icon {
    flex-shrink: 0;
}

.gps-text {
    flex: 1;
}

.gps-status {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

.gps-accuracy {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.gps-banner.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.gps-banner.success .gps-status {
    color: var(--success);
}

.gps-banner.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.gps-banner.error .gps-status {
    color: var(--danger);
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}

.form-input, select.form-input, textarea.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus, select.form-input:focus, textarea.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:disabled {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    cursor: not-allowed;
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

select.form-input {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.form-checkbox input {
    width: 20px; height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-checkbox label {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    cursor: pointer;
}

.form-checkbox label a {
    color: var(--accent);
    text-decoration: none;
}

.form-checkbox label a:hover {
    text-decoration: underline;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.form-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-link:hover {
    text-decoration: underline;
}

.form-helper {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.required {
    color: var(--danger);
}

/* ─── Alerts ─── */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.alert.visible { display: flex; }

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ─── Password Strength ─── */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-fill.weak   { width: 25%; background: var(--danger);  }
.strength-fill.fair   { width: 50%; background: var(--warning); }
.strength-fill.good   { width: 75%; background: var(--accent);  }
.strength-fill.strong { width: 100%; background: var(--success); }

.strength-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Spinner ─── */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    top: 2rem; right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger);  }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0);    }
}

/* ─── Password toggle ─── */
.password-wrapper { position: relative; }

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover { color: var(--text); }
.password-wrapper .form-input { padding-right: 3rem; }

/* ─── Section Divider ─── */
.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ─── Utility ─── */
.hidden   { display: none !important; }
.relative { position: relative; }

/* ─── PWA Install Banner ─── */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-top: 2px solid var(--accent);
    padding: 1.5rem;
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.install-banner.show {
    transform: translateY(0);
}

.install-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.install-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.install-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.install-text {
    flex: 1;
}

.install-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.install-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.install-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.install-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.install-close:hover {
    background: var(--glass);
    border-color: var(--accent);
    color: var(--text);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }
    .hero-content { max-width: 100%; }
    .hero-buttons { justify-content: center; }
    .dashboard-preview { transform: none; }
}

@media (max-width: 768px) {
    .header-buttons { gap: 0.5rem; }
    .hero { padding-top: 6rem; }
    .form-row { grid-template-columns: 1fr; }
    .remember-forgot {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .dashboard-stat { grid-template-columns: 1fr; }
    .modal-body { padding: 1.5rem; }
    .registration-type-toggle { 
        margin: 0 1.5rem 1.5rem;
        grid-template-columns: 1fr;
    }
    .gps-banner { margin: 0 1.5rem 1.5rem; }
    
    .install-banner {
        padding: 1rem;
    }

    .install-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .install-actions {
        width: 100%;
        flex-direction: column;
    }

    .install-close,
    .install-banner .btn-primary {
        width: 100%;
    }
}