/* OCPT Appointment Booking Form — Frontend Styles */

@keyframes ocptFadeIn    { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes ocptSlideIn   { from { opacity:0; transform:translateX(-12px); } to { opacity:1; transform:translateX(0); } }
@keyframes ocptSuccessPop { 0% { opacity:0; transform:scale(0.8); } 70% { transform:scale(1.06); } 100% { opacity:1; transform:scale(1); } }
@keyframes ocptSpinner   { to { transform:rotate(360deg); } }
@keyframes ocptAccent    { 0%,100%{background-position:0% 50%;} 50%{background-position:100% 50%;} }
@keyframes ocptCheckmark { 0%{stroke-dashoffset:50;} 100%{stroke-dashoffset:0;} }

/* ── Wrapper ── */
.ocpt-booking-wrap {
    max-width: 820px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    animation: ocptFadeIn 0.5s ease both;
}

/* ── Intro header ── */
.ocpt-form-title {
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 800;
    color: #000b59;
    margin: 0 0 10px;
    line-height: 1.2;
}
.ocpt-form-sub {
    font-size: 15px;
    color: #4b5563;
    margin: 0 0 32px;
    line-height: 1.6;
}

/* ── Steps ── */
.ocpt-step {
    background: #ffffff;
    border-radius: 14px;
    padding: 28px 28px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,11,89,.06), 0 6px 20px rgba(0,11,89,.07);
    border: 1px solid rgba(17,85,186,.08);
    animation: ocptFadeIn 0.5s ease both;
}
.ocpt-step:nth-child(2) { animation-delay: 0.07s; }
.ocpt-step:nth-child(3) { animation-delay: 0.14s; }

.ocpt-step-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
}
.ocpt-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1155ba, #000b59);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
}
.ocpt-step-header strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}
.ocpt-step-hint {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

/* ── Service Cards Grid ── */
.ocpt-service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.ocpt-service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 14px 18px;
    background: #f8f9ff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34,1.3,0.64,1);
    overflow: hidden;
    gap: 6px;
}
.ocpt-service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #000b59, #1155ba, #1a6fd4, #1155ba, #000b59);
    background-size: 200% 100%;
    animation: ocptAccent 5s ease infinite;
    border-radius: 10px 10px 0 0;
    opacity: 0;
    transition: opacity 0.2s;
}
.ocpt-service-card:hover {
    border-color: #1155ba;
    background: #eef3ff;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(17,85,186,.15);
}
.ocpt-service-card:hover::before { opacity: 1; }

.ocpt-service-card.selected {
    border-color: #1155ba;
    background: linear-gradient(160deg, #eef3ff 0%, #dce7ff 100%);
    box-shadow: 0 0 0 3px rgba(17,85,186,.18), 0 8px 24px rgba(17,85,186,.15);
    transform: translateY(-2px);
}
.ocpt-service-card.selected::before { opacity: 1; }

.ocpt-svc-icon {
    font-size: 28px;
    line-height: 1;
    display: block;
}
.ocpt-svc-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    display: block;
}
.ocpt-svc-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
    display: block;
}
.ocpt-service-card.selected .ocpt-svc-name { color: #000b59; }

/* ── Date + Time row ── */
.ocpt-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ── Time Toggle ── */
.ocpt-time-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ocpt-time-btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 12px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.18s ease;
}
.ocpt-time-btn:hover {
    background: #eef3ff;
    border-color: #1155ba;
    color: #1155ba;
}
.ocpt-time-btn.active {
    background: linear-gradient(135deg, #1155ba, #000b59);
    border-color: #1155ba;
    color: #fff;
    box-shadow: 0 4px 12px rgba(17,85,186,.3);
}

/* ── Form Fields ── */
.ocpt-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.ocpt-full { grid-column: 1 / -1; }

.ocpt-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ocpt-field-group label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}
.req  { color: #ef4444; }
.optional { color: #9ca3af; font-weight: 400; font-size: 12px; }

.ocpt-field-group input[type="text"],
.ocpt-field-group input[type="email"],
.ocpt-field-group input[type="tel"],
.ocpt-field-group input[type="date"],
.ocpt-field-group textarea {
    padding: 12px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.ocpt-field-group input:focus,
.ocpt-field-group textarea:focus {
    border-color: #1155ba;
    box-shadow: 0 0 0 3px rgba(17,85,186,.12);
}
.ocpt-field-group input::placeholder,
.ocpt-field-group textarea::placeholder { color: #9ca3af; }
.ocpt-field-group textarea { resize: vertical; min-height: 90px; }

/* ── Error messages ── */
.ocpt-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
    font-weight: 600;
    animation: ocptSlideIn 0.2s ease;
}
.ocpt-global-error {
    margin-top: 16px;
    padding: 14px 18px;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
}

/* ── Submit Row ── */
.ocpt-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.ocpt-privacy-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.ocpt-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #1155ba 0%, #000b59 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(17,85,186,.38);
    transition: transform 0.2s cubic-bezier(0.34,1.4,0.64,1), box-shadow 0.2s ease;
    min-width: 240px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.ocpt-submit-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -70%; width: 50%; height: 100%;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.3) 50%, transparent 70%);
    transform: skewX(-15deg);
    transition: left 0.6s ease;
}
.ocpt-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(17,85,186,.5);
}
.ocpt-submit-btn:hover::after { left: 130%; }
.ocpt-submit-btn:active { transform: translateY(0); }
.ocpt-submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

.ocpt-btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ── Success State ── */
.ocpt-success {
    text-align: center;
    padding: 52px 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,11,89,.06), 0 10px 32px rgba(0,11,89,.1);
    animation: ocptSuccessPop 0.5s cubic-bezier(0.34,1.3,0.64,1) both;
}
.ocpt-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 36px;
    line-height: 72px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(16,185,129,.35);
}
.ocpt-success h3 {
    font-size: 26px;
    font-weight: 800;
    color: #000b59;
    margin: 0 0 10px;
}
.ocpt-success p {
    font-size: 15px;
    color: #4b5563;
    margin: 0 0 28px;
    line-height: 1.6;
}
.ocpt-success-next {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    padding: 20px 24px;
    text-align: left;
    max-width: 420px;
    margin: 0 auto;
}
.ocpt-success-next strong {
    display: block;
    font-size: 14px;
    color: #065f46;
    margin-bottom: 10px;
}
.ocpt-success-next ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #374151;
    line-height: 1.8;
}
.ocpt-success-next a {
    color: #1155ba;
    font-weight: 700;
    text-decoration: none;
}
.ocpt-success-next a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .ocpt-step { padding: 20px 16px; }
    .ocpt-service-grid { grid-template-columns: repeat(2, 1fr); }
    .ocpt-date-row { grid-template-columns: 1fr; }
    .ocpt-fields-grid { grid-template-columns: 1fr; }
    .ocpt-full { grid-column: 1; }
    .ocpt-submit-row { flex-direction: column-reverse; align-items: stretch; }
    .ocpt-submit-btn { width: 100%; min-width: unset; }
    .ocpt-privacy-note { justify-content: center; }
}
@media (max-width: 400px) {
    .ocpt-service-grid { grid-template-columns: 1fr; }
}
