@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables - Light Theme */
:root {
    /* Colors */
    --bg: #F9FAFB;
    --card: #FFFFFF;
    --text: #0f172a;
    --text-dark: #1F2937;
    --muted: #6B7280;
    --brand: #22c55e;
    --primary-green: #22C55E;
    --accent: #0ea5e9;
    --border: #E5E7EB;
    --btn: #333333;
    --btn-text: #FFFFFF;
    --focus: #2563eb;
    --error-red: #EF4444;
    --info-bg: #EBF5FF;
    --info-border: #3B82F6;
    
    /* Layout */
    --header-height: 60px;
    --container-max: 1200px;
    --form-max: 800px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;
    --border-radius: 12px;
    --border-radius-sm: 6px;
}

/* Dark Theme */
:root.dark,
:root.dark-theme {
    --bg: #0b1220;
    --card: #0f172a;
    --text: #e2e8f0;
    --text-dark: #e2e8f0;
    --muted: #94a3b8;
    --brand: #22c55e;
    --accent: #38bdf8;
    --border: #1f2937;
    --btn: #e2e8f0;
    --btn-text: #0b1220;
    --error-red: #f87171;
    --info-bg: #1e3a5f;
    --info-border: #3b82f6;
}

body {
    font-family: "Roboto", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 600;
    color: var(--text);
}

/* Menu Toggle */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    z-index: 201;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.profile-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    text-decoration: none;
}

.profile-icon-circle {
    font-size: 18px;
    line-height: 1;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    display: none;
    pointer-events: none;
    opacity: 0;
    z-index: 300;
    transition: opacity 0.3s ease;
    justify-content: flex-end;
    align-items: stretch;
}

.mobile-menu.is-open {
    display: flex;
    pointer-events: auto;
    opacity: 1;
}

.mobile-menu__backdrop {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu.is-open .mobile-menu__backdrop {
    opacity: 1;
}

.mobile-menu__panel {
    width: 320px;
    max-width: 90vw;
    background: #fff;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 28px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.mobile-menu.is-open .mobile-menu__panel {
    transform: translateX(0);
}

.menu-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text);
    line-height: 1;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.menu-heading {
    font-weight: 600;
    font-size: 20px;
    color: #1f2933;
}

.menu-heading.auth-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-heading.auth-heading .menu-link {
    padding: 0;
    font-weight: 700;
}

.menu-heading.auth-heading .divider {
    color: #6b7280;
    font-weight: 600;
}

.menu-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #1f2933;
}

.menu-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.menu-link {
    color: #1f2933;
    text-decoration: none;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    transition: color 0.2s ease;
}

.menu-link:hover {
    color: #0f172a;
}

.menu-link .arrow {
    font-size: 16px;
    line-height: 1;
}

.menu-spacer {
    height: 10px;
}

/* Auth layout */
.auth-layout {
    width: 100%;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(320px, 480px);
    justify-content: center;
    align-items: start;
}

.auth-card {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    display: grid;
    gap: 12px;
    max-width: 420px;
    width: 100%;
    justify-self: center;
}

.auth-toggle {
    display: inline-flex;
    gap: 8px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
}

.auth-toggle button {
    border: none;
    background: transparent;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #374151;
}

.auth-toggle button.is-active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    color: #111827;
}

.profile-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.profile-actions .btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.profile-meta {
    display: grid;
    gap: 4px;
    font-size: 14px;
    color: #4b5563;
}

.auth-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

/* Main Content */
.main-content,
.main {
    flex: 1;
    padding: clamp(20px, 4vw, 40px) clamp(12px, 3vw, 24px);
}

.container {
    max-width: var(--form-max);
    margin: 0 auto;
}

/* Hero Section */
.hero {
    display: grid;
    gap: var(--spacing-md);
    place-items: start;
    margin-bottom: var(--spacing-lg);
}

/* Illustration */
.illustration {
    width: 100%;
    max-width: min(680px, 100%);
    aspect-ratio: 16/7;
    margin: 0 auto var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(148,163,184,.15), transparent);
    border-radius: var(--border-radius);
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 14px;
}

.illustration svg {
    width: 100%;
    height: auto;
    max-width: 300px;
}

/* Typography */
h1 {
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.1;
    margin: 0 0 var(--spacing-md);
    font-weight: 600;
    color: var(--text);
}

h2 {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 300;
    margin: 0 0 var(--spacing-md);
    color: var(--text);
}

h3 {
    font-size: clamp(12px, 3.5vw, 21px);
    font-weight: 300;
    margin: 0 0 var(--spacing-md);
    color: var(--text);
}

.page-title {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    text-align: center;
    color: var(--text);
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* Form Section */
.form-section,
.form {
    background-color: var(--card);
    padding: clamp(20px, 4vw, 30px);
    border-radius: var(--border-radius);
    animation: fadeIn 0.5s ease;
    display: grid;
    gap: var(--spacing-md);
    width: 100%;
    max-width: var(--form-max);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label,
label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text);
}

.form-input,
.input,
.form-select,
.select {
    width: 100%;
    padding: clamp(12px, 2vw, 14px) var(--spacing-md);
    font-size: clamp(14px, 2vw, 16px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background-color: var(--card);
    color: var(--text);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus,
.input:focus,
.form-select:focus,
.select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-input::placeholder,
.input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

/* Custom Select Arrow */
.form-select,
.select {
    appearance: none;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), 
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1.1em), 
                         calc(100% - 15px) calc(1.1em);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 40px;
}

.form-hint,
.help {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* Inline Grid */
.inline,
.duration-selects {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

.duration-select-wrapper {
    width: 100%;
}

/* Info Box / Badge */
.info-box,
.badge {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: var(--border-radius);
    padding: clamp(12px, 2vw, 16px);
    margin-bottom: var(--spacing-lg);
}

.info-box-content {
    display: flex;
    align-items: start;
    gap: 10px;
}

.info-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.info-text strong {
    font-weight: 600;
}

.badge {
    background: rgba(56,189,248,.15);
    border: 1px solid rgba(56,189,248,.25);
    font-size: 14px;
    display: inline-block;
}

/* Price Section */
.price-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border);
}

.price-label {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--text);
    margin-bottom: 5px;
}

.price-amount,
.price {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    color: #16a34a;
}

.price-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
}

/* Buttons */
.btn,
.btn-primary {
    appearance: none;
    display: inline-block;
    padding: clamp(12px, 2vw, 14px) clamp(16px, 3vw, 18px);
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--btn);
    color: var(--btn-text);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-family: inherit;
    touch-action: manipulation;
}

.btn:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn:focus,
.btn-primary:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    font-size: clamp(12px, 2vw, 14px);
}

.breadcrumb-item {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--muted);
}

/* Footer */
.footer {
    background-color: var(--card);
    border-top: 1px solid var(--border);
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    margin-top: auto;
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: var(--spacing-lg);
}

.footer-logo-icon {
    width: 32px;
    height: 32px;
}

.footer-logo-text {
    font-size: clamp(18px, 2.5vw, 20px);
    font-weight: 600;
    color: var(--text);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(12px, 3vw, 20px);
    margin-bottom: var(--spacing-lg);
}

.footer-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--text);
}

.footer-copyright {
    color: var(--muted);
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.error {
    color: var(--error-red);
    font-size: 14px;
    margin-top: 5px;
}

/* Mobile Optimization - Tablet */
@media (min-width: 640px) {
    .inline,
    .duration-selects {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
    
    .actions .btn {
        width: auto;
        min-width: 140px;
    }
}

/* Desktop */
@media (min-width: 768px) {
    .header-content {
        padding: 0 var(--spacing-xl);
    }
    
    .inline,
    .duration-selects {
        gap: var(--spacing-md);
    }
    
    .menu-toggle {
        display: none;
    }
}

/* Mobile Optimization - Small Screens */
@media (max-width: 639px) {
    .header-content {
        padding: 0 var(--spacing-md);
    }
    
    .mobile-menu {
        width: 85vw;
    }
    
    .form-section,
    .form {
        padding: var(--spacing-md);
        border-radius: var(--border-radius-sm);
    }
    
    .illustration {
        aspect-ratio: 4/3;
        font-size: 12px;
    }
    
    .btn,
    .btn-primary {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
    }
    
    .breadcrumb {
        font-size: 12px;
        gap: 6px;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 10px;
    }
}

/* Very Small Screens */
@media (max-width: 374px) {
    .logo-text {
        font-size: 16px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .form-input,
    .input,
    .form-select,
    .select {
        font-size: 14px;
        padding: 10px 12px;
    }
}

/* Touch Device Optimization */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .btn-primary,
    .menu-list a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .form-input,
    .input,
    .form-select,
    .select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
