* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --green-dark: #041a0a;
    --green-mid: #1a6b32;
    --green-bright: #2ecc71;
    --green-glow: #00ff66;
    --blue-circle: #a8d8ea;
    --blue-text: #1a2a4a;
    --white: #ffffff;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

html {
    height: 100%;
    height: 100dvh;
}

body {
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--green-dark);
    color: var(--white);
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
    overscroll-behavior: none;
}

/* ===== LOADER ===== */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

.loader.active {
    opacity: 1;
    visibility: visible;
}

.loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

#particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.loader-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 70%, rgba(0, 255, 100, 0.3) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 30%, rgba(46, 204, 113, 0.2) 0%, transparent 50%),
        linear-gradient(170deg, #041a0a 0%, #0d3d1c 45%, #1a5c2e 75%, #0a2812 100%);
    z-index: 0;
    animation: bgPulse 4s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.12); }
}

.loader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
}

.logo-ring {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-spinner {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: var(--green-glow);
    border-right-color: rgba(0, 255, 100, 0.25);
    animation: spin 1s linear infinite;
}

.ring-spinner::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-bottom-color: rgba(168, 216, 234, 0.4);
    animation: spin 1.8s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.logo-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(145deg, #c5e8f5 0%, #a8d8ea 50%, #8ecae6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 50px rgba(168, 216, 234, 0.45),
        0 10px 40px rgba(0, 0, 0, 0.35),
        inset 0 2px 4px rgba(255, 255, 255, 0.35);
    animation: logoPulse 2s ease-in-out infinite;
}

.logo-circle.small {
    width: 72px;
    height: 72px;
}

.logo-circle.small .logo-text {
    font-size: 1.75rem;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 2.75rem;
    color: var(--blue-text);
    letter-spacing: -2px;
}

.loading-bar {
    width: 180px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green-glow), var(--blue-circle));
    border-radius: 4px;
    animation: loadProgress 2.2s ease-in-out forwards;
    box-shadow: 0 0 12px var(--green-glow);
}

@keyframes loadProgress {
    0% { width: 0%; }
    25% { width: 35%; }
    55% { width: 65%; }
    100% { width: 100%; }
}

.loading-status {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loader-footer {
    position: absolute;
    bottom: calc(2.5rem + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--white);
    letter-spacing: 0.5px;
}

.powered-by {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.2rem;
    letter-spacing: 1.5px;
    text-transform: lowercase;
}

/* ===== MAIN APP (MOBILE FIRST) ===== */
.main {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0, 255, 100, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(46, 204, 113, 0.06) 0%, transparent 40%),
        linear-gradient(180deg, #041a0a 0%, #0a2812 50%, #041a0a 100%);
    transition: opacity 0.4s ease;
}

.main.hidden {
    opacity: 0;
    pointer-events: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding:
        calc(1.5rem + var(--safe-top))
        calc(1.25rem + var(--safe-right))
        calc(1rem + var(--safe-bottom))
        calc(1.25rem + var(--safe-left));
    max-width: 480px;
    margin: 0 auto;
}

/* Top Section */
.top-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 1rem 0;
}

.hero-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 100, 0.15) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: glowMove 5s ease-in-out infinite alternate;
}

@keyframes glowMove {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -48%) scale(1.15); opacity: 1; }
}

.hero-logo {
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.top-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 1;
    line-height: 1.1;
}

.top-section h1 span {
    background: linear-gradient(90deg, var(--green-glow), var(--blue-circle));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

/* Bottom CTA */
.bottom-cta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
    position: relative;
    z-index: 1;
}

.btn-row {
    display: flex;
    gap: 0.75rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
    border: none;
    letter-spacing: 0.3px;
    min-height: 54px;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-icon {
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1a8a3f 0%, var(--green-bright) 100%);
    color: var(--white);
    box-shadow: 0 6px 24px rgba(0, 255, 100, 0.35);
    width: 100%;
}

.btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-outline {
    flex: 1;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 1.25rem 0 0.5rem;
    position: relative;
    z-index: 1;
}

.site-footer .brand-name {
    font-size: 0.85rem;
}

.site-footer .powered-by {
    font-size: 0.65rem;
}

/* Small phones */
@media (max-height: 680px) {
    .top-section h1 {
        font-size: 2rem;
    }

    .logo-circle.small {
        width: 60px;
        height: 60px;
    }

    .logo-circle.small .logo-text {
        font-size: 1.5rem;
    }

    .btn {
        min-height: 48px;
        padding: 0.85rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .app-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }

    .top-section {
        flex: none;
        width: 45%;
    }

    .bottom-cta {
        flex: 1;
        min-width: 200px;
    }

    .site-footer {
        width: 100%;
        padding: 0.5rem 0;
    }
}

/* Tablet & Desktop */
@media (min-width: 481px) {
    .app-container {
        padding-top: calc(2rem + var(--safe-top));
    }

    .top-section h1 {
        font-size: 3rem;
    }

    .logo-circle.small {
        width: 88px;
        height: 88px;
    }

    .logo-circle.small .logo-text {
        font-size: 2.1rem;
    }

    .btn {
        border-radius: 50px;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 32px rgba(0, 255, 100, 0.45);
    }

    .btn-secondary:hover,
    .btn-outline:hover {
        transform: translateY(-1px);
    }
}

/* ===== AUTH FORMS ===== */
.form-page {
    overflow-y: auto;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0, 255, 100, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #041a0a 0%, #0a2812 50%, #041a0a 100%);
}

.form-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    padding:
        calc(1.25rem + var(--safe-top))
        calc(1.25rem + var(--safe-right))
        calc(1.5rem + var(--safe-bottom))
        calc(1.25rem + var(--safe-left));
}

.back-btn {
    display: inline-block;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    margin: 1rem 0 0.35rem;
}

.form-header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.logo-circle.tiny {
    width: 56px;
    height: 56px;
    margin: 0 auto;
}

.logo-circle.tiny .logo-text {
    font-size: 1.4rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
    border-color: var(--green-glow);
    background: rgba(255, 255, 255, 0.08);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap input {
    padding-right: 4.5rem;
}

.toggle-pass {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--green-glow);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
}

.checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    margin-top: 0.25rem;
}

.checkbox-wrap input {
    margin-top: 0.15rem;
    accent-color: var(--green-bright);
}

.form-error {
    background: rgba(255, 60, 60, 0.15);
    border: 1px solid rgba(255, 80, 80, 0.4);
    color: #ff8a8a;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
}

.form-error.hidden {
    display: none;
}

.form-success {
    background: rgba(0, 255, 100, 0.12);
    border: 1px solid rgba(0, 255, 100, 0.35);
    color: var(--green-glow);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
}

.form-success.hidden {
    display: none;
}

.forgot-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--green-glow);
    text-decoration: none;
    text-align: right;
    width: 100%;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.form-footer a {
    color: var(--green-glow);
    text-decoration: none;
    font-weight: 600;
}

.user-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
}

.user-row:last-child {
    border-bottom: none;
}

.user-row span {
    color: rgba(255, 255, 255, 0.5);
}

.user-row strong {
    color: var(--white);
    font-weight: 500;
}

.dashboard .form-header {
    margin-bottom: 1.5rem;
}

/* ===== PHONE COUNTRY PICKER ===== */
.phone-input-wrap {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.phone-input-wrap input {
    flex: 1;
    min-width: 0;
}

.country-picker {
    position: relative;
    flex-shrink: 0;
}

.country-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 100%;
    min-height: 50px;
    padding: 0 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.country-btn.open,
.country-btn:active {
    border-color: var(--green-glow);
    background: rgba(255, 255, 255, 0.1);
}

.country-btn .flag {
    font-size: 1.35rem;
    line-height: 1;
}

.country-btn .dial {
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.country-btn .arrow {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 0.1rem;
    transition: transform 0.2s;
}

.country-btn.open .arrow {
    transform: rotate(180deg);
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(320px, calc(100vw - 2.5rem));
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background: #0d2e18;
    border: 1px solid rgba(0, 255, 100, 0.2);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}

.country-dropdown.open {
    max-height: 320px;
    opacity: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.country-search {
    width: calc(100% - 1rem);
    margin: 0.5rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    color: var(--white);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    flex-shrink: 0;
}

.country-search:focus {
    border-color: var(--green-glow);
}

.country-search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.country-list {
    overflow-y: auto;
    max-height: 250px;
    padding: 0.25rem 0.5rem 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 0.6rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--white);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.country-item:active,
.country-item.active {
    background: rgba(0, 255, 100, 0.12);
}

.country-flag {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.country-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.85);
}

.country-dial {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.country-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    font-size: 0.85rem;
}


/* Google Continue — matches existing Autobet form style */
.google-auth-block{margin:0 0 1rem}
.btn-google{
  width:100%;display:flex;align-items:center;justify-content:center;gap:10px;
  min-height:48px;padding:12px 16px;border-radius:12px;cursor:pointer;
  border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);
  color:#fff;font:600 15px Inter,system-ui,sans-serif;
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
}
.btn-google svg{width:20px;height:20px;flex-shrink:0}
.btn-google:active{transform:scale(.97);opacity:.9}
.btn-google:disabled,.btn-google.is-disabled{opacity:.55;cursor:not-allowed}
.google-hint{margin-top:10px;font-size:12px;color:rgba(255,255,255,.55);line-height:1.45;text-align:center}
.google-hint.hidden{display:none}
.auth-or{display:flex;align-items:center;gap:12px;margin:0 0 1rem;color:rgba(255,255,255,.4);font-size:12px}
.auth-or::before,.auth-or::after{content:"";flex:1;height:1px;background:rgba(255,255,255,.12)}
