/* ============================================================
   Instant Turf Quote — Styles
   Mobile-first responsive design
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --primary: #2d7a3a;
    --primary-dark: #1e5c2a;
    --primary-light: #4a9e58;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --bg: #f8faf8;
    --bg-card: #ffffff;
    --text: #1a2e1a;
    --text-secondary: #5a6b5a;
    --text-muted: #8a9b8a;
    --border: #d4e4d4;
    --border-light: #e8f0e8;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- App Container --- */
.app-container {
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.app-header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(45, 122, 58, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    white-space: nowrap;
}

.header-dashboard-link:hover {
    background: rgba(255, 255, 255, 0.25);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.app-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.app-subtitle {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 12px 16px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* --- Steps --- */
.step {
    animation: fadeIn 0.3s ease;
}

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

.step-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-header h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.step-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* --- Upload Area --- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-card);
    margin-bottom: 16px;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(45, 122, 58, 0.04);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Buttons --- */
.button-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
    width: 100%;
}

.btn:active {
    transform: scale(0.97);
}

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

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

.btn-accent {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(45, 122, 58, 0.06);
}

.btn-accent {
    background: var(--accent);
    color: white;
    font-size: 17px;
}

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

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

.btn-outline:hover {
    border-color: var(--text-secondary);
}

.btn-lg {
    padding: 16px 24px;
    font-size: 17px;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    font-size: 18px;
}

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

/* --- Camera --- */
.camera-container {
    margin: 16px 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: black;
}

.camera-container video {
    width: 100%;
    display: block;
    border-radius: var(--radius) var(--radius) 0 0;
}

.camera-controls {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #111;
}

.camera-controls .btn {
    flex: 1;
}

/* --- Preview --- */
.preview-container {
    margin: 16px 0;
    text-align: center;
}

.preview-image {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

/* --- Turf Selection --- */
.turf-selection {
    margin: 20px 0;
}

.turf-selection h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.turf-options {
    display: flex;
    gap: 10px;
}

.turf-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: var(--bg-card);
}

.turf-option:hover {
    border-color: var(--primary-light);
}

.turf-option.selected {
    border-color: var(--primary);
    background: rgba(45, 122, 58, 0.05);
}

.turf-option input {
    display: none;
}

.turf-option span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.turf-swatch {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.turf-swatch.natural {
    background: linear-gradient(135deg, #4CAF50, #66BB6A, #43A047);
}

.turf-swatch.premium {
    background: linear-gradient(135deg, #2E7D32, #388E3C, #1B5E20);
}

.turf-swatch.sport {
    background: linear-gradient(135deg, #43A047, #66BB6A, #2E7D32);
}

.project-type-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border-radius: 8px;
    background: rgba(45, 122, 58, 0.08);
}

/* --- Manual Square Footage Input --- */
.manual-sqft-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 12px;
}

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

.optional-tag {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
}

.manual-sqft-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.manual-sqft-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
}

.manual-sqft-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 122, 58, 0.1);
}

.manual-sqft-input::placeholder {
    color: var(--text-muted);
}

.manual-sqft-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.manual-sqft-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.custom-notes-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 12px;
}

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

.custom-notes-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}

.custom-notes-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 122, 58, 0.1);
}

.custom-notes-input::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

.custom-notes-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.revision-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.revision-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.revision-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.revision-section .custom-notes-input {
    margin-bottom: 0;
}

.revision-loading {
    text-align: center;
    padding: 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- Loading --- */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

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

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

.loading-container h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    max-width: 280px;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progress 3s ease-in-out forwards;
}

@keyframes progress {
    0% { width: 0%; }
    20% { width: 25%; }
    50% { width: 50%; }
    80% { width: 75%; }
    100% { width: 90%; }
}

/* --- Comparison --- */
.comparison-container {
    margin-bottom: 24px;
}

.comparison-tabs {
    display: flex;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 12px;
}

.tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.comparison-view {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--bg-card);
    position: relative;
}

.result-image {
    width: 100%;
    display: block;
}

/* --- Slider View --- */
.slider-view {
    position: relative;
}

.slider-wrapper {
    position: relative;
    overflow: hidden;
}

.slider-wrapper .slider-img {
    width: 100%;
    display: block;
}

.slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.slider-overlay .slider-img {
    width: 200%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

.slider-control {
    position: absolute;
    bottom: 40px;
    left: 10%;
    width: 80%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    outline: none;
    z-index: 10;
}

.slider-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Quote Card --- */
.quote-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quote-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.quote-badge {
    background: rgba(45, 122, 58, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quote-details {
    margin-bottom: 16px;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.quote-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.quote-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.quote-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

.quote-total .quote-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.quote-total .quote-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.quote-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.quote-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 10px 12px;
    margin-top: 8px;
    background: #fef9ee;
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    font-style: italic;
}

.quote-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Result Actions --- */
.result-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.result-actions .btn {
    width: 100%;
}

/* --- Error --- */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

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

.error-container h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.error-container p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Footer --- */
.app-footer {
    text-align: center;
    padding: 16px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
}

.rep-login-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.rep-login-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* --- Before & After Gallery --- */
.showcase {
    margin: 32px 0 20px;
    text-align: center;
}

.showcase-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

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

.gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gallery-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    padding: 8px;
}

.gallery-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-label {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.label-before {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.label-after {
    background: var(--primary);
    color: #fff;
}

/* --- Desktop Styles --- */
@media (min-width: 768px) {
    .main-content {
        padding: 32px 40px;
    }

    .upload-area {
        padding: 60px 40px;
    }

    #step-upload {
        max-width: 600px;
        margin: 0 auto;
    }

    .showcase {
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .main-content {
        padding: 32px 60px;
    }
}

/* --- Add-Ons Selection (customer-facing) --- */
.addons-selection {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 28px 24px;
    margin-top: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.addons-selection-header {
    text-align: center;
    margin-bottom: 20px;
}

.addons-selection-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.addons-selection-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.addons-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.addon-check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg);
}

.addon-check-item:hover {
    border-color: var(--primary-light);
    background: #f0fdf4;
}

.addon-check-item:has(input:checked) {
    border-color: var(--primary);
    background: #f0fdf4;
    box-shadow: 0 0 0 1px var(--primary);
}

.addon-check-item input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.addon-check-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.addon-check-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.addon-check-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.addons-custom {
    margin-top: 12px;
}

.addons-custom input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s;
}

.addons-custom input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 122, 58, 0.1);
}

.addons-custom input::placeholder {
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .addons-checklist {
        grid-template-columns: 1fr;
    }
    .addons-selection {
        padding: 20px 16px;
    }
}

/* --- Inline Lead Capture (after quote) --- */
.connect-inline {
    background: var(--primary);
    border-radius: 16px;
    padding: 40px 32px;
    margin-top: 28px;
}

.connect-inline-header {
    text-align: center;
    margin-bottom: 28px;
}

.connect-inline-header h2 {
    font-size: 26px;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.connect-inline-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    max-width: 460px;
    margin: 0 auto;
}

.lead-inline-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lead-inline-form input,
.lead-inline-form textarea {
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 16px;
    color: #1a1a1a;
    background: white;
    outline: none;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
}

.lead-inline-form input:focus,
.lead-inline-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.lead-inline-form input::placeholder,
.lead-inline-form textarea::placeholder {
    color: #6b7280;
    font-weight: 500;
}

.lead-inline-form textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-lead-submit {
    width: 100%;
    padding: 16px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.btn-lead-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-lead-submit:active {
    transform: translateY(0);
}

.btn-lead-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 480px) {
    .connect-inline {
        padding: 28px 20px;
        border-radius: 12px;
    }
    .connect-inline-header h2 {
        font-size: 22px;
    }
    .lead-inline-form input,
    .lead-inline-form textarea {
        padding: 14px 16px;
        font-size: 15px;
    }
}
