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

/* COLORS — OCTONOS BRAND */
:root {
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(147, 180, 126, 0.2);
    --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --glass-blur: blur(40px);

    /* Octonos Brand Colors */
    --primary: #93B47E;
    --primary-hover: #7A9B69;
    --primary-light: #A5C292;
    --secondary: #2C9EA4;
    --secondary-hover: #238a8f;
    
    --text-primary: #1A1A1A;
    --text-secondary: #7A7A7A;
    --text-tertiary: #3D3D3D;
    
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-border: #D9D9D9;
    --input-focus: #93B47E;

    /* Backgrounds */
    --bg-light: #FAFAFA;
    --bg-white: #FFFFFF;
    --bg-gray: #F2F2F2;

    /* Status Colors */
    --error: #D32F2F;
    --success: #2E7D32;
    --warning: #F9A825;

    /* Border Radius */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

/* PAGE BACKGROUND */
html {
    min-height: 100vh;
    background: var(--bg-light);
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at top left, rgba(147, 180, 126, 0.08) 0%, transparent 50%),
        radial-gradient(circle at bottom right, rgba(44, 158, 164, 0.06) 0%, transparent 50%),
        #FAFAFA;
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 20px;
    overflow-x: hidden;
    margin: 0;
}

/* GLASS CARD */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;

    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);

    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);

    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 16px 48px rgba(0, 0, 0, 0.08);
    padding: 48px 40px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* LOGO */
.logo {
    width: 88px;
    height: 88px;
    display: block;
    margin: 0 auto 28px;
    padding: 18px;
    background: white;
    border-radius: 22px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04);
}

/* SECTION HEADERS */
.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* STEP INDICATOR */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--input-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 16px;
    background: var(--bg-white);
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(147, 180, 126, 0.15);
}

.step.completed .step-number {
    background: rgba(46, 125, 50, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.step-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step.active .step-label {
    color: var(--text-primary);
}

/* DIVIDER BETWEEN STEPS */
.step-divider,
.step-line {
    width: 40px;
    height: 2px;
    background: var(--input-border);
    margin-top: -24px;
}

/* DIVIDER */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--input-border);
}

/* GOOGLE BUTTON */
.btn-google {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-google:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* FORM GROUPS */
.form-group {
    margin-bottom: 20px;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.required {
    color: var(--error);
}

/* INPUTS & SELECTS */
input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.3s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}

select {
    color: var(--text-primary);
    cursor: pointer;
}

select option {
    background: var(--bg-white);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--input-focus);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(147, 180, 126, 0.1);
}

/* PRIMARY BUTTON */
.btn-primary {
    width: 100%;
    padding: 14px 16px;
    background: var(--secondary);
    border-radius: var(--radius-sm);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 158, 164, 0.25);
}

.btn-primary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 158, 164, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* SECONDARY/BACK BUTTON */
.btn-back,
.btn-secondary {
    margin-top: 12px;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    border: 1px solid var(--input-border);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover,
.btn-secondary:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* PLAN CARDS */
.plan-options,
.plan-cards {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.plan-card {
    background: var(--bg-white);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.plan-card:hover {
    background: rgba(147, 180, 126, 0.03);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.plan-card.selected,
.plan-card.featured {
    border-color: var(--primary);
    background: rgba(147, 180, 126, 0.05);
    box-shadow: 0 4px 12px rgba(147, 180, 126, 0.15);
}

.plan-header h2 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.plan-price {
    margin-bottom: 16px;
}

.plan-price .price {
    color: var(--secondary);
    font-size: 32px;
    font-weight: 700;
}

.plan-price .period {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.plan-features {
    margin-bottom: 16px;
}

.plan-features .feature,
.plan-card li {
    color: var(--text-primary);
    font-size: 14px;
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.plan-features .feature::before,
.plan-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

.plan-features .feature.muted {
    color: var(--text-secondary);
    opacity: 0.6;
}

.plan-features .feature.muted::before {
    content: '○';
    color: var(--text-secondary);
}

.plan-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* PREMIUM/PLAN BADGE */
.premium-badge,
.plan-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* PLAN BUTTONS */
.btn-plan,
.btn-premium {
    width: 100%;
    padding: 14px 16px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 158, 164, 0.25);
}

.btn-plan:hover,
.btn-premium:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 158, 164, 0.35);
}

.btn-plan:active,
.btn-premium:active {
    transform: translateY(0);
}

.btn-plan:disabled,
.btn-premium:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* SUCCESS SCREEN */
.success-screen {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(46, 125, 50, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 48px;
    height: 48px;
    color: var(--success);
    filter: drop-shadow(0 0 12px rgba(46, 125, 50, 0.3));
}

.success-screen h2 {
    color: var(--text-primary);
    font-size: 24px;
    margin-bottom: 12px;
}

.success-screen p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

/* ERROR MESSAGES */
.error-message,
.message.error-message {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--error);
    font-size: 14px;
    margin-bottom: 16px;
}

.success-message,
.message.success-message {
    background: rgba(46, 125, 50, 0.1);
    border: 1px solid rgba(46, 125, 50, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--success);
    font-size: 14px;
    margin-bottom: 16px;
}

/* TOGGLE AUTH LINK */
.toggle-auth {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-auth a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.toggle-auth a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* MOBILE RESPONSIVE */
@media (max-width: 580px) {
    .auth-card {
        padding: 36px 28px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .step-indicator {
        gap: 12px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .step-divider,
    .step-line {
        width: 30px;
    }

    .plan-card {
        padding: 20px;
    }

    .form-group-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
/* Loading Spinner for Button */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
  }
  
  /* Loading Overlay for Stripe Redirect */
  #stripe-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
  }
  
  .loading-content {
    text-align: center;
    color: white;
  }
  
  .spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(147, 51, 234, 0.2);
    border-top-color: #9333ea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
  }
  
  .loading-content p {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  /* Disabled button state */
  .btn-plan:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }
  /* Hide error and success boxes by default */
#signup-error,
#signup-success {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show boxes when they have the 'show' class */
#signup-error.show,
#signup-success.show {
  display: block;
  opacity: 1;
}

/* Optional: Add smooth slide-in animation */
#signup-error.show,
#signup-success.show {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}