/* ============ Reset & Base ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --secondary: #06b6d4;
    --accent: #f43f5e;
    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============ Header ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    color: var(--text);
}

.logo-accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quota-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-alt);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.quota-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.quota-badge.low .quota-dot { background: var(--warning); }
.quota-badge.empty .quota-dot { background: var(--error); }
.quota-badge.empty { color: var(--error); }

/* Credits Badge */
.credits-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    transition: all 0.2s;
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary-light);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown button {
    display: flex;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background 0.15s;
}

.lang-dropdown button:hover {
    background: var(--bg-alt);
}

/* ============ Hero ============ */
.hero {
    text-align: center;
    padding: 48px 24px 24px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ============ Generator Section ============ */
.generator-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.input-panel, .result-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
}

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

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

textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
    background: var(--bg);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--card);
}

textarea::placeholder {
    color: var(--text-light);
}

.prompt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-link:hover { opacity: 0.7; }

/* ============ Prompt Tip & Ideas ============ */
.prompt-tip {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: 8px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    line-height: 1.4;
}

.prompt-ideas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.prompt-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.prompt-chip .chip-emoji {
    font-size: 14px;
    flex-shrink: 0;
}

.prompt-chip .chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.style-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.style-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.style-card.active {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.06);
}

.style-emoji {
    font-size: 22px;
}

.style-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.style-card.active .style-name {
    color: var(--primary);
}

/* Size Grid */
.size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.size-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.size-card:hover {
    border-color: var(--primary-light);
}

.size-card.active {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.06);
}

.size-preview {
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    margin-bottom: 2px;
}

.ratio-square { width: 28px; height: 28px; }
.ratio-landscape { width: 36px; height: 20px; }
.ratio-portrait { width: 20px; height: 36px; }

.size-card span {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.size-card small {
    font-size: 11px;
    color: var(--text-light);
}

/* Model Grid */
.model-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.model-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
    position: relative;
}

.model-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.model-card.active {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.06);
}

.model-card-pro.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}

.model-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-card .model-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.model-card.active .model-name {
    color: var(--primary);
}

.model-card-pro.active .model-name {
    color: #b45309;
}

.model-cost {
    font-size: 11px;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 6px;
}

.model-desc {
    font-size: 10px;
    color: var(--text-light);
}

.model-free-tag {
    font-size: 10px;
    color: var(--success);
    font-weight: 600;
    margin-top: 2px;
}

.model-free-tag-none {
    color: var(--text-light);
}

/* Credit Cost Table */
.credit-cost-table {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.credit-cost-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.credit-cost-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.credit-cost-item.highlight {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.credit-cost-item .cost-model {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.credit-cost-item .cost-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
}

.credit-cost-item.highlight .cost-value {
    color: #b45309;
}

.credit-cost-item .cost-rp {
    font-size: 11px;
    color: var(--text-light);
}

/* Payment Methods */
.payment-methods {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pay-tag {
    background: var(--bg-alt);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

/* Dropdown Credits Box */
.dropdown-credits-box {
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    margin: -8px -8px 8px -8px;
    border-radius: 8px 8px 0 0;
}

.dropdown-credits-box .credits-row,
.dropdown-credits-box .free-quota-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.dropdown-credits-box .credits-label {
    font-size: 12px;
    color: #92400e;
    font-weight: 600;
}

.dropdown-credits-box .credits-value {
    font-size: 16px;
    font-weight: 800;
    color: #78350f;
}

.btn-topup {
    width: 100%;
    padding: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s;
}

.btn-topup:hover {
    background: var(--primary-dark);
}

/* Enterprise pricing card */
.pricing-card-enterprise {
    border: 2px solid #fcd34d;
}

.pricing-card-enterprise .pricing-header h3 {
    color: #92400e;
}

.amount-small {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

/* Generate Button */
.btn-generate {
    width: 100%;
    padding: 16px;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hint-text {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

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

/* ============ Result Panel ============ */
.result-empty, .result-loading, .result-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.empty-icon, .error-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.result-empty p {
    color: var(--text-secondary);
    font-size: 15px;
}

.empty-sub {
    font-size: 13px !important;
    color: var(--text-light) !important;
    margin-top: 4px;
}

/* Loading Animation */
.loading-animation {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.loading-bar {
    width: 8px;
    height: 40px;
    background: var(--gradient);
    border-radius: 4px;
    animation: loadingBounce 1.2s infinite ease-in-out;
}

.loading-bar:nth-child(2) { animation-delay: 0.15s; }
.loading-bar:nth-child(3) { animation-delay: 0.3s; }

@keyframes loadingBounce {
    0%, 60%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    30% { transform: scaleY(1); opacity: 1; }
}

.result-loading p {
    color: var(--text);
    font-weight: 600;
}

.loading-sub {
    font-size: 13px !important;
    color: var(--text-light) !important;
    font-weight: 400 !important;
}

/* Result Content */
.result-content img {
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s;
}

.btn-action:hover {
    background: var(--card);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* Prompt Details */
.prompt-details {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.prompt-details summary {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-alt);
    transition: background 0.2s;
}

.prompt-details summary:hover {
    background: var(--bg);
}

.prompt-detail-content {
    padding: 16px;
}

.prompt-row {
    margin-bottom: 12px;
}

.prompt-row:last-child {
    margin-bottom: 0;
}

.prompt-row label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-row p {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

/* Error State */
.result-error p {
    color: var(--error);
    font-weight: 600;
}

.error-sub {
    font-size: 13px !important;
    color: var(--text-light) !important;
    font-weight: 400 !important;
    margin-top: 4px;
}

/* ============ Gallery ============ */
.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.gallery-grid img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--text-light);
}

/* ============ Pricing ============ */
.pricing-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

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

.pricing-card-popular {
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pricing-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-bottom: 24px;
}

.currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

.amount {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
}

.period {
    font-size: 14px;
    color: var(--text-light);
}

.package-desc {
    font-size: 13px;
    color: var(--text-light);
    margin: -14px 0 16px;
    min-height: 18px;
}

.pricing-features {
    list-style: none;
    margin-bottom: 24px;
    text-align: left;
}

.pricing-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.btn-plan {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-plan-popular {
    background: var(--gradient);
    color: white;
    border: none;
}

.btn-plan-popular:hover {
    opacity: 0.9;
}

.btn-plan-current {
    border-color: var(--border);
    color: var(--text-light);
    cursor: default;
}

.btn-plan-current:hover {
    background: transparent;
    color: var(--text-light);
}

/* ============ Footer ============ */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    margin-top: 48px;
}

/* ============ Features Section ============ */
.features-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all 0.3s;
    text-align: center;
}

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

.feature-icon {
    font-size: 40px;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============ FAQ Section ============ */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-item summary {
    padding: 16px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 22px;
    font-weight: 300;
    color: var(--primary);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background: var(--bg-alt);
}

.faq-item p {
    padding: 0 20px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-sep {
    margin: 0 4px;
}

/* ============ Spinner ============ */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .generator-container {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 26px;
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 600px) {
    .header-inner {
        padding: 12px 16px;
    }

    .quota-badge {
        padding: 4px 10px;
        font-size: 12px;
    }

    .hero {
        padding: 32px 16px 16px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .generator-section, .gallery-section, .pricing-section, .features-section, .faq-section {
        padding: 16px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .input-panel, .result-panel {
        padding: 16px;
    }

    .model-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .credit-cost-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============ Auth: Header User Area ============ */
.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--gradient);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.user-area {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-info:hover {
    border-color: var(--primary-light);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-plan-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-alt);
    color: var(--text-secondary);
    text-transform: uppercase;
}

.user-plan-badge.pro,
.user-plan-badge.commercial {
    background: linear-gradient(135deg, #f59e0b, #f43f5e);
    color: white;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 200;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown button {
    display: flex;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background 0.15s;
    font-family: inherit;
    color: var(--text);
    gap: 6px;
}

.user-dropdown button:hover {
    background: var(--bg-alt);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.logout-btn {
    color: var(--error) !important;
}

/* ============ Modal ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlide 0.3s ease;
}

.modal-wide {
    max-width: 800px;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-alt);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}

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

.auth-tab:hover:not(.active) {
    color: var(--text);
}

/* Auth Form */
.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
    background: var(--bg);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--card);
}

.phone-row {
    display: flex;
    gap: 8px;
}

.phone-row .phone-country {
    flex: 0 0 150px;
    padding: 12px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}

.phone-row .phone-country:focus {
    outline: none;
    border-color: var(--primary-light);
}

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

.btn-auth-small {
    flex: 0 0 auto;
    width: auto !important;
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.auth-error {
    background: rgba(239, 68, 68, 0.08);
    color: var(--error);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-success {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-footer {
    text-align: center;
    margin-top: 14px;
}

.auth-footer a {
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover { text-decoration: underline; }

.pwd-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
    line-height: 1.4;
}

.pwd-strength {
    margin-top: 8px;
}

.pwd-strength-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.pwd-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.3s;
}

.pwd-strength-fill.weak { width: 33%; background: #ef4444; }
.pwd-strength-fill.medium { width: 66%; background: #f59e0b; }
.pwd-strength-fill.strong { width: 100%; background: #10b981; }

.pwd-strength-text {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    display: block;
}

.pwd-strength-text.weak { color: #ef4444; }
.pwd-strength-text.medium { color: #f59e0b; }
.pwd-strength-text.strong { color: #10b981; }

/* Dropdown sub info */
.dropdown-sub-info {
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.sub-plan-row, .sub-quota-row, .sub-expire-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}

.sub-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.sub-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.sub-value.pro { color: #7c3aed; }
.sub-value.commercial { color: #2563eb; }
.sub-value.expired { color: #ef4444; }

.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* My Images Grid */
.my-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.my-images-grid .img-card {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.my-images-grid .img-card:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.my-images-grid .img-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.my-images-grid .img-card .img-meta {
    padding: 8px 10px;
    background: var(--bg-alt);
    font-size: 11px;
    color: var(--text-secondary);
}

.my-images-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--text-light);
}

/* Responsive additions */
@media (max-width: 600px) {
    .user-name {
        display: none;
    }

    .modal {
        padding: 24px 20px;
    }

    .my-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
