:root {
    --primary: #D97757;
    --primary-light: #E89980;
    --primary-dark: #C45B3A;
    --secondary: #5B8E7D;
    --secondary-light: #7DAA9A;
    --accent: #F2C94C;
    --bg-white: #FFFFFF;
    --bg-cream: #FAF8F5;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --danger: #E85D75;
    --success: #5B8E7D;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Top Banner */
.top-banner {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    padding: 12px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 100;
}

.top-banner p {
    margin: 0;
    color: white;
    font-size: 15px;
    font-weight: 500;
}

.top-banner a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.top-banner a:hover {
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-cream);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 0 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.logo svg {
    width: 48px;
    height: 48px;
}

.logo h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 36px;
    font-weight: 400;
    margin: 0;
}

.tagline {
    color: var(--gray-600);
    font-size: 16px;
    margin-top: 8px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'DM Serif Display', serif;
    font-size: 42px;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Auth Container */
.auth-container {
    max-width: 480px;
    margin: 40px auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-100);
}

.auth-tab {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab.active {
    color: var(--primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.auth-form {
    display: none;
    padding: 32px;
}

.auth-form.active {
    display: block;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.form-input, .select-input {
    padding: 14px 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    color: var(--gray-900);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.form-input:focus, .select-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
}

.form-hint {
    font-size: 13px;
    color: var(--gray-500);
}

.checkbox-group {
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-700);
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.form-footer {
    text-align: center;
    margin-top: 16px;
}

.form-description {
    color: var(--gray-600);
    font-size: 15px;
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    padding: 8px 0;
}

.back-btn:hover {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--bg-white);
}

.btn-secondary:hover {
    background: var(--secondary-light);
}

.btn-danger {
    background: var(--danger);
    color: var(--bg-white);
}

.btn-danger:hover {
    background: #d44a63;
}

.btn-full {
    width: 100%;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.link:hover {
    text-decoration: underline;
}

/* Features */
.features {
    max-width: 900px;
    margin: 60px auto;
    padding: 40px 20px;
}

.features-title {
    font-family: 'DM Serif Display', serif;
    font-size: 32px;
    text-align: center;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.feature p {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.5;
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gray-900);
    color: var(--bg-white);
    padding: 20px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-content p {
    flex: 1;
    font-size: 14px;
    margin: 0;
}

.cookie-content a {
    color: var(--accent);
    text-decoration: underline;
}

/* App Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin: 20px 0;
}

.card h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.subtitle {
    color: var(--gray-600);
    font-size: 16px;
    margin-bottom: 24px;
}

/* Credits Display */
.credits-display {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin: 24px 0;
}

.credits-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.credits-value {
    color: var(--bg-white);
    font-family: 'DM Serif Display', serif;
    font-size: 48px;
    font-weight: 400;
}

/* Coupon Section */
.coupon-section {
    margin: 24px 0;
}

.coupon-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0 16px;
}

.coupon-divider::before,
.coupon-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.coupon-divider span {
    padding: 0 16px;
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.coupon-input-group {
    display: flex;
    gap: 8px;
}

.coupon-input {
    flex: 1;
    padding: 14px 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-900);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.coupon-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
}

.coupon-message {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.coupon-message.success {
    display: block;
    background: var(--secondary-light);
    color: var(--bg-white);
}

.coupon-message.error {
    display: block;
    background: var(--danger);
    color: var(--bg-white);
}

/* Packages */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.package-card {
    background: var(--bg-white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.package-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.package-card.recommended {
    border-color: var(--primary);
    background: linear-gradient(135deg, #FFF5F0, var(--bg-white));
}

.package-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.package-badge.best {
    background: var(--accent);
    color: var(--gray-900);
}

.package-hours {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    color: var(--gray-900);
    margin: 12px 0;
}

.package-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0;
}

.package-desc {
    font-size: 14px;
    color: var(--gray-600);
    margin: 12px 0 20px;
}

.btn-package {
    width: 100%;
}

/* App Header */
.app-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-family: 'DM Serif Display', serif;
    font-size: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    font-size: 14px;
    color: var(--gray-600);
}

.icon-btn {
    padding: 8px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-700);
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--gray-200);
    color: var(--primary);
}

/* Context Buttons */
.context-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.context-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-700);
    font-weight: 500;
}

.context-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary);
}

.context-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--bg-white);
}

.context-btn svg {
    width: 32px;
    height: 32px;
}

/* Translator Screen */
.translator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.lang-indicator {
    display: flex;
    gap: 8px;
}

.lang-badge, .context-badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.lang-badge {
    background: var(--primary-light);
    color: var(--bg-white);
}

.context-badge {
    background: var(--gray-100);
    color: var(--gray-700);
}

.credits-mini {
    padding: 6px 12px;
    background: var(--accent);
    color: var(--gray-900);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
}

/* Session Info */
.session-info {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.session-stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: 24px;
    color: var(--gray-900);
}

/* Conversation Area */
.conversation-area {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.conversation-log {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 360px;
    color: var(--gray-400);
    text-align: center;
}

.empty-state svg {
    margin-bottom: 16px;
}

.message {
    padding: 16px;
    border-radius: var(--radius-md);
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    background: var(--primary-light);
    color: var(--bg-white);
    margin-left: auto;
}

.message.translation {
    background: var(--gray-100);
    color: var(--gray-900);
}

.message.coached {
    background: var(--secondary-light);
    color: white;
    border-left: 4px solid var(--secondary);
    font-weight: 500;
}

.message.system {
    background: var(--accent);
    color: var(--gray-900);
    margin: 0 auto;
    text-align: center;
    font-weight: 600;
}

.message-text {
    font-size: 15px;
    line-height: 1.5;
}

.message-meta {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Context Info */
.context-info {
    margin-top: 16px;
    padding: 16px;
    background: var(--secondary-light);
    color: var(--bg-white);
    border-radius: var(--radius-md);
}

.context-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
}

.context-info p {
    font-size: 14px;
    line-height: 1.5;
}

/* Record Button */
.record-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.record-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
}

.record-btn-inner {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.record-btn:hover .record-btn-inner {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.record-btn:active .record-btn-inner {
    transform: scale(0.95);
}

.record-btn.recording .record-btn-inner {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

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

.record-btn-inner svg {
    color: var(--bg-white);
}

.record-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 20px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-btn:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
}

.account-info {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    background: var(--gray-900);
    color: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideUp 0.3s ease;
    max-width: 90%;
}

.toast.hidden {
    display: none;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    color: var(--gray-700);
    font-weight: 600;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
    font-size: 14px;
}

.footer-links {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: var(--gray-600);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Legal Pages */
.legal-page {
    max-width: 800px;
}

.legal-header {
    padding: 40px 0 20px;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 16px;
    display: inline-block;
}

.back-link:hover {
    text-decoration: underline;
}

.legal-header h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 36px;
    margin-bottom: 8px;
}

.last-updated {
    color: var(--gray-500);
    font-size: 14px;
}

.legal-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 20px 0;
}

.legal-content section {
    margin-bottom: 32px;
}

.legal-content h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 24px;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.legal-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 20px 0 12px;
}

.legal-content p {
    margin-bottom: 12px;
    line-height: 1.7;
}

.legal-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.legal-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.legal-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-footer {
    text-align: center;
    padding: 40px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .top-banner {
        padding: 10px 15px;
    }
    
    .top-banner p {
        font-size: 13px;
    }

    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .context-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .cookie-content {
        flex-direction: column;
    }
    
    .legal-content {
        padding: 24px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}