:root {
    --brand-primary: #0f172a;
    --brand-secondary: #334155;
    --brand-accent: #3b82f6;
    --brand-accent-hover: #2563eb;
    --brand-muted: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--brand-accent);
    text-decoration: none;
}

.page-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.card {
    background: #f8f9fa;
    border-radius: 20px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 48px;
    backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
    .page-shell {
        padding: 24px 16px 48px;
    }
    .card {
        padding: 24px;
        border-radius: 16px;
    }
}

h1 {
    color: var(--brand-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    letter-spacing: -0.025em;
}

h2 {
    color: var(--brand-primary);
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

h3 {
    color: var(--brand-secondary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

h4 {
    color: var(--brand-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

p {
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 0 16px 0;
}

.section-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

pre {
    font-family: inherit;
    white-space: pre-wrap;
    margin: 0;
}

form {
    display: grid;
    gap: 20px;
}

label {
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    font-size: 15px;
    transition: all 0.2s ease;
    font-family: inherit;
    background: #fff;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* Contact and Social Grids */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.contact-grid-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Address Form Layout */
.address-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.social-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.social-platform {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--brand-primary);
    font-size: 0.95rem;
}

.social-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 1rem;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.section-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .contact-grid,
    .contact-grid-three,
    .social-grid,
    .address-row {
        grid-template-columns: 1fr;
    }
}

.section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.section:first-of-type {
    margin-top: 0;
}

.section h2 {
    color: #667eea;
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 1.5rem;
}

.section h3 {
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.notice {
    padding: 16px 20px;
    border-radius: 12px;
    background: #fef3c7;
    border: 2px solid #fbbf24;
    color: #92400e;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
}

.notice ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.error {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.success {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.01em;
}

.button:disabled,
.button[disabled] {
    cursor: not-allowed;
    background: #cbd5e1;
    color: #94a3b8;
    box-shadow: none;
    opacity: 0.6;
}

.button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.button:not(:disabled):active {
    transform: translateY(0);
}

.tos-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.download-tos-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.download-tos-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.download-tos-btn svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .tos-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .download-tos-btn {
        font-size: 0.85rem;
        padding: 8px 14px;
        width: 100%;
        justify-content: center;
    }
}

.tos-box {
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 20px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tos-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    cursor: pointer;
}

.tos-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--brand-accent);
}

.design-options {
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
    border-radius: 16px;
    border: 2px solid var(--border-color);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

/* Typography Section Styles */
.typography-section {
    margin-bottom: 32px;
}

/* Dual Typography Selector */
.typography-dual-select {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: flex-end;
}

@media (max-width: 640px) {
    .typography-dual-select {
        flex-direction: column;
        align-items: stretch;
    }
}

.font-select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.font-select-group label {
    font-weight: 600;
    color: var(--brand-primary);
    font-size: 0.9rem;
}

.font-select-group select {
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.font-select-group select:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.font-select-group option {
    padding: 8px;
}

.typography-preview-dual {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 32px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.preview-heading-dual {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 12px;
    line-height: 1.2;
    transition: font-family 0.3s ease;
}

.preview-subheading-dual {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--brand-secondary);
    margin-bottom: 16px;
    line-height: 1.3;
    transition: font-family 0.3s ease;
}

.preview-paragraph-dual {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: font-family 0.3s ease;
}

.preview-meta-dual {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

@media (max-width: 640px) {
    .typography-preview-dual {
        padding: 24px 20px;
    }
    
    .preview-heading-dual {
        font-size: 1.65rem;
    }
    
    .preview-subheading-dual {
        font-size: 1.15rem;
    }
    
    .preview-paragraph-dual {
        font-size: 0.9rem;
    }
}

/* Modern Theme Selector */
.theme-options-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .theme-options-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

.theme-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.theme-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-card-inner {
    position: relative;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.theme-card:hover .theme-card-inner {
    border-color: var(--brand-accent);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.theme-card input[type="radio"]:checked ~ .theme-card-inner {
    border-color: var(--brand-accent);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 8px 24px rgba(59, 130, 246, 0.2);
}

.theme-swatches-modern {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.theme-swatch-modern {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease;
}

.theme-card:hover .theme-swatch-modern {
    transform: scale(1.1);
}

.theme-label {
    font-weight: 600;
    color: var(--brand-primary);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.3;
}

.theme-sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -6px;
}

.theme-checkmark {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--brand-accent);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.theme-card input[type="radio"]:checked ~ .theme-card-inner .theme-checkmark {
    opacity: 1;
    transform: scale(1);
}

.theme-card-custom .custom-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-accent);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.theme-card-custom:hover .custom-icon {
    opacity: 1;
    transform: rotate(90deg);
}

.theme-card-custom input[type="radio"]:checked ~ .theme-card-inner .custom-icon {
    opacity: 1;
    color: var(--brand-primary);
}

/* Custom Color Panel */
.custom-color-panel {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

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

.custom-color-panel h4 {
    margin: 0 0 8px 0;
    color: var(--brand-primary);
    font-size: 1.1rem;
}

.custom-color-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.custom-color-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

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

.color-input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-primary);
}

.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.color-input-wrapper input[type="text"]:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-color-preview {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.custom-swatch {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

@media (max-width: 640px) {
    .custom-color-inputs {
        grid-template-columns: 1fr;
    }
    
    .custom-swatch {
        width: 60px;
        height: 60px;
    }
}

.upload-zone {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    background: linear-gradient(to bottom, #fafbfc, #ffffff);
    transition: all 0.2s ease;
}

.upload-zone.dragover {
    border-color: var(--brand-accent);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone button {
    margin-top: 12px;
}

.previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.preview-thumb {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #dbe3ef;
    background: #fff;
}

.status-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #5a6575;
    margin-top: 8px;
}

.confirmation {
    text-align: center;
    padding: 32px;
}

.generator-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.generator-output {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #d4dbe5;
    border-radius: 12px;
    background: #fefefe;
    word-break: break-word;
}

.copy-button {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--brand-accent);
    background: transparent;
    color: var(--brand-accent);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-button:hover {
    background: rgba(59, 130, 246, 0.08);
}

.rate-limit {
    font-size: 14px;
    color: var(--danger);
    font-weight: 600;
}

/* Note/Info Boxes */
.note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

.note strong {
    color: #856404;
}

.note.info {
    background: #d1ecf1;
    border-left-color: #0dcaf0;
}

.note.info strong {
    color: #055160;
}

