/* ── Dental Service Request Form ── */

:root {
    --dsr-primary:      #1a56db;
    --dsr-primary-dark: #1441a8;
    --dsr-border:       #d1d5db;
    --dsr-bg:           #f9fafb;
    --dsr-bg-white:     #ffffff;
    --dsr-text:         #111827;
    --dsr-text-muted:   #6b7280;
    --dsr-red:          #dc2626;
    --dsr-green:        #16a34a;
    --dsr-section-dot:  #1a56db;
    --dsr-radius:       8px;
    --dsr-shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

.dsr-wrapper {
    max-width: 860px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--dsr-text);
    font-size: 15px;
    line-height: 1.5;
}

/* ── Alerts ── */
.dsr-alert {
    padding: 14px 18px;
    border-radius: var(--dsr-radius);
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid transparent;
}
.dsr-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: var(--dsr-green);
}
.dsr-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--dsr-red);
}

/* ── Section Cards ── */
.dsr-section {
    background: var(--dsr-bg-white);
    border: 1px solid var(--dsr-border);
    border-radius: var(--dsr-radius);
    box-shadow: var(--dsr-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.dsr-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--dsr-bg);
    border-bottom: 1px solid var(--dsr-border);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .01em;
}

.dsr-section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e8effc;
    color: var(--dsr-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0;
}
.dsr-section-icon svg { width: 15px; height: 15px; }

.dsr-section-hint {
    margin-left: auto;
    font-weight: 400;
    font-size: 13px;
    color: var(--dsr-text-muted);
}

.dsr-section-body {
    padding: 20px;
}

/* ── Grid ── */
.dsr-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.dsr-row:last-child {
    margin-bottom: 0;
}

.dsr-col          { flex: 1; min-width: 200px; }
.dsr-col-half     { flex: 1 1 calc(50% - 8px); min-width: 200px; }
.dsr-col-third    { flex: 1 1 calc(33.333% - 11px); min-width: 160px; }

/* ── Inputs ── */
.dsr-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dsr-text);
    margin-bottom: 6px;
    letter-spacing: .01em;
}

.dsr-req {
    color: var(--dsr-red);
    margin-left: 2px;
}

.dsr-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 13px;
    border: 1px solid var(--dsr-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--dsr-text);
    background: var(--dsr-bg-white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    font-family: inherit;
}

/* Placeholders noticeably lighter than labels/typed text, so hints
   never read as real input (theme default made them almost black) */
.dsr-input::placeholder,
.dsr-textarea::placeholder {
    color: #b8bfc9 !important;
    opacity: 1 !important;   /* Firefox dims placeholders by default */
}
.dsr-input:focus {
    border-color: var(--dsr-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* Red border only AFTER the user has interacted with the field —
   :invalid alone (or with :placeholder-shown, which never matches
   selects / inputs without a placeholder) flags required fields
   as errors on page load, before any submit attempt. */
.dsr-input:user-invalid {
    border-color: var(--dsr-red);
}

.dsr-textarea {
    resize: vertical;
    min-height: 110px;
}

.dsr-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Upload Zone ── */
.dsr-upload-zone {
    border: 2px dashed var(--dsr-border);
    border-radius: var(--dsr-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--dsr-bg);
}

.dsr-upload-zone:hover,
.dsr-upload-zone.dsr-drag-over {
    border-color: var(--dsr-primary);
    background: #eff6ff;
}

.dsr-upload-icon {
    color: var(--dsr-text-muted);
    margin-bottom: 12px;
}
.dsr-upload-zone:hover .dsr-upload-icon,
.dsr-upload-zone.dsr-drag-over .dsr-upload-icon {
    color: var(--dsr-primary);
}

.dsr-upload-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--dsr-text);
}

.dsr-upload-sub {
    font-size: 13px;
    color: var(--dsr-text-muted);
    margin: 0;
}

.dsr-upload-browse {
    background: none;
    border: none;
    padding: 0;
    color: var(--dsr-primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}
.dsr-upload-browse:hover {
    color: var(--dsr-primary-dark);
}

/* ── File List ── */
.dsr-file-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dsr-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--dsr-bg);
    border: 1px solid var(--dsr-border);
    border-radius: 6px;
    animation: dsr-slide-in .2s ease;
}

@keyframes dsr-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dsr-file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.dsr-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--dsr-primary);
    text-transform: uppercase;
}

.dsr-file-info {
    flex: 1;
    min-width: 0;
}
.dsr-file-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dsr-file-size {
    font-size: 12px;
    color: var(--dsr-text-muted);
}

.dsr-file-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dsr-text-muted);
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.dsr-file-remove:hover {
    color: var(--dsr-red);
    background: #fef2f2;
}

/* ── Submit ── */
.dsr-submit-row {
    text-align: right;
    margin-top: 8px;
}

.dsr-btn-submit {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 15px 24px;
    /* !important so the theme's generic button colours can't repaint it —
       the gradient guarantees contrast, so the text stays white everywhere.
       The gradient is wider than the button; hover glides it sideways. */
    background: linear-gradient(135deg, #1a56db 0%, #3b82f6 60%, #1a56db 100%) !important;
    background-size: 220% 100% !important;
    background-position: 0% 0 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 7px !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background-position .45s ease, filter .2s ease, transform .15s ease;
}

.dsr-btn-submit:hover:not(:disabled) {
    /* no shadow — the gradient glides across and brightens slightly */
    background-position: 100% 0 !important;
    filter: brightness(1.07);
    color: #fff !important;
}
.dsr-btn-submit:active:not(:disabled) {
    transform: scale(.99);
    filter: brightness(.94);
}
.dsr-btn-submit:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .45);
    outline-offset: 2px;
}
.dsr-btn-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    filter: saturate(.6);
}

@keyframes dsr-rotate {
    to { transform: rotate(360deg); }
}
.dsr-spin {
    animation: dsr-rotate .7s linear infinite;
}

/* ── Login Notice ── */
.dsr-login-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--dsr-radius);
    padding: 18px 22px;
    color: var(--dsr-text);
}
.dsr-login-notice a {
    color: var(--dsr-primary);
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .dsr-col-half,
    .dsr-col-third {
        flex: 1 1 100%;
    }
    .dsr-btn-submit {
        width: 100%;
        justify-content: center;
    }
    .dsr-submit-row {
        text-align: center;
    }
    .dsr-section-hint {
        display: none;
    }
}

/* ── Uniform corner radius on every field inside the form ── */
.dsr-wrapper input[type="text"],
.dsr-wrapper input[type="email"],
.dsr-wrapper input[type="tel"],
.dsr-wrapper input[type="date"],
.dsr-wrapper input[type="time"],
.dsr-wrapper input[type="number"],
.dsr-wrapper select,
.dsr-wrapper textarea {
    border-radius: 6px;
}

/* Read-only fields (e.g. locked email for logged-in users) */
.dsr-input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

/* ── Email verification step (guest submissions) ── */
.dsr-verify-box {
    border: 1px solid var(--dsr-border);
    border-radius: 10px;
    background: var(--dsr-bg);
    padding: 26px 24px;
    text-align: center;
    margin-top: 14px;
}
.dsr-verify-box h3 { margin: 0 0 6px; font-size: 17px; }
.dsr-verify-box p  { margin: 0 0 16px; color: #6b7280; font-size: 13.5px; }
.dsr-verify-code {
    width: 190px !important;
    text-align: center;
    font-size: 22px !important;
    letter-spacing: 8px;
    font-weight: 700;
    margin: 0 auto 14px;
    display: block;
}

/* ── DPC section ─────────────────────────────────────────────── */
/* Fields whose value is already on file for the clinic are locked */
.dsr-input.dsr-locked {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
    cursor: not-allowed;
}
.dsr-input.dsr-locked:focus {
    border-color: #e5e7eb;
    box-shadow: none;
}
.dsr-dpc-note {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: #92700c;
    background: #fef9e7;
    border: 1px solid #f5e6b8;
    border-radius: 8px;
    padding: 8px 12px;
}

/* ── Canadian phone inputs (+1 prefix) ───────────────────────── */
.dsr-phone-wrap { display: flex; align-items: stretch; }
.dsr-phone-prefix {
    display: inline-flex; align-items: center;
    padding: 0 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    /* flat inner corners so prefix + input read as one control */
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    font-weight: 700; font-size: 14px; color: #6b7280;
    user-select: none;
}
.dsr-phone-wrap .dsr-input {
    border-radius: 0 10px 10px 0;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    flex: 1 1 auto;
    min-width: 0;
}
.dsr-input.dsr-phone-bad {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

/* ── Side content panel (sticky on desktop) ──────────────────── */
/* Without side content the layout is a plain block — form keeps its
   classic centred 860px width. With it, the wrapper widens and turns
   into a two-column grid: sticky copy on the left, form on the right. */
.dsr-wrapper.dsr-has-aside { max-width: 1220px; }
.dsr-has-aside .dsr-layout {
    display: grid;
    grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}
.dsr-aside {
    position: sticky;
    top: 100px;             /* clears most sticky theme headers */
}
.dsr-aside-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e6eaf1;
    border-radius: 18px;
    padding: 30px 28px 28px;
    box-shadow: 0 10px 34px rgba(15, 23, 42, .07);
}
/* Accent bar across the top */
.dsr-aside-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--dsr-primary) 0%, #60a5fa 100%);
}
/* Soft glow in the corner for depth */
.dsr-aside-card::after {
    content: '';
    position: absolute;
    top: -70px; right: -70px;
    width: 190px; height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26, 86, 219, .07) 0%, rgba(26, 86, 219, 0) 70%);
    pointer-events: none;
}
.dsr-aside-icon {
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--dsr-primary) 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(26, 86, 219, .32);
    margin-bottom: 20px;
    position: relative; z-index: 1;
}
.dsr-aside-content { position: relative; z-index: 1; }
.dsr-aside-content h1,
.dsr-aside-content h2 {
    margin: 0 0 14px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: #0f172a;
}
.dsr-aside-content h3 {
    margin: 18px 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}
.dsr-aside-content p {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.78;
    color: #5b6472;
}
.dsr-aside-content p:last-child { margin-bottom: 0; }
.dsr-aside-content strong { color: #1e293b; }
.dsr-aside-content a { color: var(--dsr-primary); }
.dsr-aside-content ul {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}
.dsr-aside-content ul li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #5b6472;
}
.dsr-aside-content ul li::before {
    content: '';
    position: absolute;
    left: 0; top: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #e4edfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a56db' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 9px no-repeat;
}

/* Tablet & mobile: single column, copy above the form, no sticky */
@media (max-width: 991.98px) {
    .dsr-wrapper.dsr-has-aside { max-width: 860px; }
    .dsr-has-aside .dsr-layout {
        grid-template-columns: 1fr;
        gap: 26px;
    }
    .dsr-aside { position: static; }
    .dsr-aside-card { padding: 24px 22px; }
    .dsr-aside-content h1,
    .dsr-aside-content h2 { font-size: 22px; }
}
