/* ===== Smart Tone – Digital Form page ===== */
:root {
    --st-orange: #f39200;
    --st-blue: #1f9cde;
    --st-text: #414141;
    --st-muted: #797979;
    --st-border: #dddddd;
    --st-error: #dc3545;
    --st-success: #28a745;
    --st-radius: 8px;
}

img { max-width: 100%; }

/* Header band behind the transparent desktop navbar (same gradient as the home hero) */
.page-header {
    background: linear-gradient(rgb(31 156 222), rgb(243 146 0)), url(../../img/hero-bg.jpg) center / cover no-repeat;
    color: #fff;
    text-align: center;
    padding: 60px 0 90px;
}
.page-header h1 { color: #fff; font-weight: 700; font-size: 2.5rem; margin-bottom: 0.5rem; }
.page-header p { color: #fff; font-size: 1.05rem; max-width: 640px; margin: 0 auto; opacity: 0.95; }
@media (min-width: 992px) {
    .page-header { padding-top: 150px; }
}

.apply-container { margin-top: -60px; position: relative; z-index: 2; max-width: 900px; }

.form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.form-card-header {
    background: var(--st-orange);
    color: #fff;
    text-align: center;
    padding: 1.5rem 1rem;
}
.form-card-header h2 { color: #fff; font-size: 1.6rem; font-weight: 700; margin: 0 0 0.25rem; }
.form-card-header p { color: #fff; margin: 0; font-size: 0.9rem; opacity: 0.9; }

.wifi-form { position: relative; padding: 2rem 2.5rem 2.5rem; color: var(--st-text); }

.form-section { padding-bottom: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid #eee; }
.form-section .section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--st-orange);
    margin-bottom: 1.1rem;
}
.wifi-form label { font-size: 0.9rem; font-weight: 600; color: var(--st-text); margin-bottom: 0.35rem; }
.wifi-form .form-control {
    border-radius: var(--st-radius);
    border: 1px solid var(--st-border);
    min-height: 46px;
    font-size: 1rem; /* 16px stops iOS zooming into fields */
    color: var(--st-text);
}
.wifi-form .form-control:focus { border-color: var(--st-orange); box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.18); }
.wifi-form .form-control.error,
.wifi-form .error > .form-control,
.wifi-form .form-control:invalid.error { border-color: var(--st-error); }
.wifi-form .form-group.error .form-control,
.wifi-form .form-control.error { border-color: var(--st-error); }
.wifi-form .error-message { color: var(--st-error); font-size: 0.85rem; margin-top: 0.35rem; }
.wifi-form .form-banner { text-align: center; margin: 0 0 1rem; }

/* Visually hidden (honeypot, radio buttons, file inputs) */
.hp-field,
.product-option input,
.upload-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
}
.hp-field { top: 0; left: 0; }

/* Product type cards */
.product-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.product-option { position: relative; cursor: pointer; margin: 0; }
.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.5rem;
    border: 2px solid var(--st-border);
    border-radius: var(--st-radius);
    background: #fff;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.product-card i { font-size: 1.6rem; color: var(--st-orange); }
.product-card strong { font-size: 1rem; line-height: 1.3; color: var(--st-text); }
.product-option:hover .product-card { border-color: var(--st-orange); }
.product-option input:checked + .product-card {
    border-color: var(--st-orange);
    background: rgba(243, 146, 0, 0.08);
    box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.18);
}
.product-option input:focus-visible + .product-card { outline: 2px solid var(--st-orange); outline-offset: 2px; }
.product-options.error .product-card { border-color: var(--st-error); }

/* Uploads */
.upload-hint { font-size: 0.875rem; color: var(--st-muted); margin: -0.5rem 0 1rem; }
.upload-label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; }
.wifi-form label.upload-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin: 0;
    border: 2px dashed var(--st-border);
    border-radius: var(--st-radius);
    background: #fafafa;
    cursor: pointer;
    font-weight: 500;
    min-width: 0;
    transition: border-color 0.2s;
}
.upload-box i { font-size: 1.25rem; color: var(--st-orange); flex-shrink: 0; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wifi-form label.upload-box:hover,
.upload-input:focus-visible + .upload-box { border-color: var(--st-orange); }
.upload-group.has-file label.upload-box { border-style: solid; border-color: var(--st-success); background: #fff; }
.upload-group.error label.upload-box { border-color: var(--st-error); }

/* Upload preview */
.upload-preview { margin-top: 0.75rem; border: 1px solid var(--st-border); border-radius: var(--st-radius); background: #fff; overflow: hidden; }
.preview-frame {
    display: flex; align-items: center; justify-content: center;
    height: 180px; padding: 0.5rem; background: #f1f5f9; cursor: zoom-in; position: relative;
}
.preview-frame img,
.preview-frame canvas {
    max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
    border-radius: 4px; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15); background: #fff;
}
.preview-frame i { font-size: 3rem; color: #94a3b8; }
.preview-frame.is-pdf i { color: #dc2626; }
.preview-frame.is-loading::after {
    content: ""; position: absolute; bottom: 12px; width: 28px; height: 28px;
    border: 3px solid rgba(243, 146, 0, 0.2); border-top-color: var(--st-orange); border-radius: 50%;
    animation: stSpin 0.8s linear infinite;
}
.preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.75rem; flex-wrap: wrap; }
.preview-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 8rem; }
.preview-name { font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-size { font-size: 0.75rem; color: var(--st-muted); }
.preview-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.wifi-form .preview-btn {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0.35rem 0.7rem; margin: 0;
    font-size: 0.8rem; font-weight: 600; line-height: 1.2; font-family: inherit;
    border: 1px solid var(--st-border); border-radius: 6px; background: #fff;
    color: var(--st-orange); text-decoration: none; cursor: pointer;
}
.wifi-form .preview-btn:hover { border-color: var(--st-orange); text-decoration: none; }
.wifi-form .preview-remove { color: var(--st-error); }

/* Privacy + submit */
.privacy-notice {
    display: flex; gap: 1rem; align-items: flex-start;
    background: #fff8ec; border: 1px solid #fde3b8; border-radius: var(--st-radius);
    padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.privacy-notice i { font-size: 1.5rem; color: var(--st-orange); margin-top: 2px; }
.privacy-notice p { margin: 0; font-size: 0.875rem; color: var(--st-text); }
.form-actions { text-align: center; }
.btn-submit {
    background: var(--st-orange); color: #fff; border: 0; border-radius: 50px;
    padding: 0.85rem 2.5rem; font-size: 1rem; font-weight: 600; min-height: 48px;
    transition: background 0.2s, transform 0.2s;
}
.btn-submit:hover, .btn-submit:focus { background: #d98200; color: #fff; }
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; }

/* Loading overlay */
.loading-overlay {
    position: fixed; inset: 0; z-index: 2000; display: none;
    align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); padding: 16px;
}
.loading-overlay.active { display: flex; }
.loading-box { background: #fff; border-radius: 12px; padding: 2rem 2.5rem; text-align: center; }
.loading-box p { margin: 1rem 0 0; font-weight: 600; color: var(--st-text); }
.spinner {
    width: 48px; height: 48px; margin: 0 auto;
    border: 4px solid rgba(243, 146, 0, 0.2); border-top-color: var(--st-orange); border-radius: 50%;
    animation: stSpin 0.8s linear infinite;
}
@keyframes stSpin { to { transform: rotate(360deg); } }

/* Success modal */
.success-modal {
    position: fixed; inset: 0; z-index: 2001; display: none;
    align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); padding: 16px;
}
.success-modal.active { display: flex; }
.success-content { background: #fff; border-radius: 12px; padding: 2rem; max-width: 440px; width: 100%; text-align: center; }
.success-content i { font-size: 3.5rem; color: var(--st-success); margin-bottom: 0.75rem; }
.success-content h3 { font-size: 1.35rem; font-weight: 700; color: var(--st-text); }
.success-content p { color: var(--st-muted); margin-bottom: 1.25rem; }

.footer { margin-top: 60px; }

/* Tablets / phones */
@media (max-width: 767.98px) {
    .page-header { padding: 40px 0 80px; }
    .page-header h1 { font-size: 2rem; }
    .wifi-form { padding: 1.5rem 1.1rem 2rem; }
    .apply-container { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 575.98px) {
    .page-header h1 { font-size: 1.75rem; }
    .page-header p { font-size: 0.95rem; }
    .form-card-header h2 { font-size: 1.3rem; }
    .product-options { grid-template-columns: 1fr; gap: 0.6rem; }
    .product-card { flex-direction: row; justify-content: center; padding: 0.9rem; }
    .privacy-notice { flex-direction: column; gap: 0.5rem; padding: 1rem; }
    .btn-submit { width: 100%; }
    .preview-frame { height: 160px; }
}

/* Comments word counter */
.word-count { display: block; text-align: right; font-size: 0.8rem; color: var(--st-muted); margin-top: 0.3rem; }
.word-count.over { color: var(--st-error); font-weight: 600; }

/* Two product choices on the Apply page */
.product-options.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 575.98px) { .product-options.two { grid-template-columns: 1fr; } }
