@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --primary-color: #0f6dda;
    --primary-hover: #0a58b0;
    --secondary-color: #64748b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 600px;
    /* Mobile-first limit for "narrow, vertically stacked content" */
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-color);
    font-family: var(--font-heading);
}

.highlight {
    color: var(--primary-color);
}

/* Main Content */
.site-main {
    flex: 1;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hero {
    text-align: center;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3.25rem;
    /* Slightly larger */
    line-height: 1.1;
    margin-bottom: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #227de6, #0b61c5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    /* Increased margin as requested */
}

/* Example Image */
.example-preview {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.example-preview img {
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.caption {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
}

/* Sales Points */
.sales-points {
    display: flex;
    flex-direction: row;
    /* Force row direction */
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.point {
    flex: 1;
    /* Equal width tiles */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--surface-color);
    padding: 0.75rem 0.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 0;
    /* Prevent overflow */
}

.point .icon {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
}

.point .text strong {
    display: block;
    font-size: 1.2rem;
    color: var(--primary-color);
    white-space: nowrap;
    /* Keep on one line if possible */
}

.point .text small {
    display: block;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Preview Benefits Modifier */
.preview-benefits {
    max-width: 500px;
    margin: 1rem auto 2rem;
}

.preview-benefits .point {
    padding: 1rem;
    border-color: var(--primary-color);
    background: #f0f9ff;
}


/* Upload Grid (Side by Side) */
.upload-grid {
    display: flex;
    flex-direction: row;
    /* Force row direction */
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: stretch;
    /* Equal height */
}

.grid-item {
    flex: 0 0 calc(50% - 0.375rem);
    /* Explicit 50% width minus half-gap */
    width: calc(50% - 0.375rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* Example Item */
.example-item {
    padding: 1rem;
    text-align: center;
}

.example-thumb {
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    /* Square */
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

/* Upload Buttons */
.btn-upload-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin: 0;
    text-align: center;
    color: var(--text-color);
    flex: 1;
    /* evenly fill space */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-height: 0;
    /* allows flex shrinking if needed */

    /* Reset Mobile UA Styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    line-height: inherit;
    text-transform: none;
    touch-action: manipulation;
}

.btn-upload-action:hover,
.btn-upload-action:active {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-upload-action .icon {
    font-size: 3rem;
}

.btn-upload-action .label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

/* Primary "Take Selfie" Style */
.btn-upload-action.primary {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border-color: #cbd5e1;
    color: var(--primary-color);
}

/* Secondary "Upload" Style */
.btn-upload-action:not(.primary) {
    background: transparent;
    border: 1px dashed #cbd5e1;
    color: var(--text-muted);
}

.btn-upload-action:not(.primary):hover {
    background: rgba(255, 255, 255, 0.5);
    border-style: solid;
    color: var(--primary-color);
}

/* Upload Item */
.upload-area {
    width: 100%;
    height: 100%;
    /* Fill the grid item */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f0f9ff;
    border: 2px dashed #bfdbfe;
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    aspect-ratio: 1/1;
    /* Square match */
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.upload-text {
    font-size: 0.9rem;
    line-height: 1.3;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Footer */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.site-footer p {
    text-align: center;
}

/* Responsive */
@media (min-width: 640px) {
    .container {
        padding: 0 2rem;
    }
}

/* Mobile Adjustments for Upload Buttons */
@media (max-width: 639px) {
    .btn-upload-action .icon {
        font-size: 2rem;
        /* Reduced from 3rem */
    }

    .btn-upload-action .label {
        font-size: 0.9rem;
        /* Reduced from 1rem */
    }
}

/* Preview & Results Page */
.results-hero,
.preview-hero {
    padding: 2rem 0;
    text-align: center;
}

.preview-hero p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.results-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.result-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: fit-content;
}

.preview-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

/* Preview Grid */
.preview-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.preview-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    display: block;
}

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(29, 103, 192, 0.8);
    color: white;
    font-size: 0.7rem;
    padding: 2px;
    text-align: center;
}

/* Checkout Card */
.checkout-card {
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.pricing-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
}

.pricing-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.price-wrapper {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.2rem;
    margin-bottom: 1.6rem;
    line-height: 1.2;
}

.price-amount {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -0.2rem;
}

.price-currency {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.2rem;
}

p.secure-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 4px;
}

.secure-icon {
    color: var(--success-color);
}

.separator {
    color: var(--border-color);
}

.checkout-form-container {
    padding: 2rem;
}

.checkout-loader {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.express-checkout-container {
    margin-bottom: 1rem;
}

.payment-message {
    color: var(--error-color);
    margin-top: 0.5rem;
    font-size: 0.9rem;
    display: none;
}

.dev-mode-container {
    margin-top: 3rem;
    padding: 1rem;
    border-top: 1px dashed var(--border-color);
}

.processing-payment {
    padding: 2rem;
    background: #eff6ff;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Results Page Actions */
.actions {
    margin-top: 4rem;
    background: var(--surface-color);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.actions h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.actions .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.action-group {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    /* keep button and input aligned */
    max-width: 100%;
}

.input-group input {
    flex: 1;
    /* Both inputs will stretch equally */
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    min-width: 0;
    height: 48px;
    /* Force consistent height */
}

.input-group input:focus {
    outline: 2px solid var(--primary-color);
    border-color: transparent;
}

.input-group .btn {
    width: 140px;
    /* Fixed width for standard button sizes to ensure inputs are matched length */
    flex: 0 0 140px;
    white-space: nowrap;
    padding: 0 1.5rem;
    font-weight: 500;
    height: 48px;
    /* Match input height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 1.5em;
    text-align: center;
    display: none;
    /* Hidden by default until JS triggers it */
}

.email-status:not(:empty) {
    display: block;
    /* Show when it has content */
}

.email-status.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.email-status.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.result-card img {
    border-radius: 8px;
    margin-bottom: 1rem;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-05 {
    margin-top: 0.5rem;
}

/* Rate Limit Warning Block */
.rate-limit-warning {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-align: center;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}