/* gridops-cal-kyaw — Customer booking portal */

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

:root {
    --blue: #0067b1;
    --blue-dark: #004f8a;
    --blue-light: #e8f4fd;
    --green: #107c10;
    --green-light: #e6f5e6;
    --red: #d32f2f;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Header ──────────────────────────────────────────────────── */

.header {
    background: white;
    color: var(--gray-800);
    padding: 16px 24px;
    border-bottom: 3px solid var(--blue);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 640px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo-img {
    height: 40px;
    width: auto;
}

.header-back-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-back-btn:hover {
    background: var(--blue-light);
}

.lang-toggle {
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.78rem;
    color: var(--gray-600);
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}

.lang-toggle:hover {
    background: var(--gray-100);
}

.header-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--blue);
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

/* ─── Layout ──────────────────────────────────────────────────── */

.main {
    flex: 1;
    padding: 24px 16px 40px;
}

.container {
    max-width: 640px;
    margin: 0 auto;
}

/* ─── Steps ───────────────────────────────────────────────────── */

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    position: sticky;
    top: 68px;
    z-index: 99;
    background: var(--gray-50);
    padding: 16px 0;
    margin-top: -16px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.step.active .step-number {
    background: var(--blue);
    color: white;
}

.step.done .step-number {
    background: var(--green);
    color: white;
}

.step-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 500;
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--blue);
    font-weight: 600;
}

.step.done .step-label {
    color: var(--green);
}

.step-line {
    width: 48px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 8px;
    margin-bottom: 20px;
    transition: background 0.2s;
}

.step-line.done {
    background: var(--green);
}

/* ─── Card ────────────────────────────────────────────────────── */

.card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.card-desc {
    color: var(--gray-500);
    font-size: 0.88rem;
    margin-bottom: 20px;
}

/* ─── Form ────────────────────────────────────────────────────── */

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--gray-800);
    transition: border-color 0.15s;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 103, 177, 0.1);
}

.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--gray-800);
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.15s;
}

.optional-tag {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 400;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ─── Buttons ─────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    width: 100%;
}

.btn-primary {
    background: var(--blue);
    color: white;
    margin-top: 8px;
}

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

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-danger-outline {
    background: white;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

.btn-link {
    background: none;
    color: var(--gray-500);
    font-size: 0.82rem;
    padding: 12px 0 0;
    text-align: left;
    width: auto;
}

.btn-link:hover {
    color: var(--blue);
}

/* ─── Error ───────────────────────────────────────────────────── */

.error-msg {
    background: #fef2f2;
    color: var(--red);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    border: 1px solid #fecaca;
}

.error-inline {
    color: var(--red);
    font-size: 0.85rem;
    padding: 8px 0;
}

.loading-text {
    color: var(--gray-400);
    font-size: 0.85rem;
    padding: 12px 0;
    text-align: center;
}

/* ─── Account Banner ──────────────────────────────────────────── */

.account-banner {
    background: var(--blue-light);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.banner-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.banner-address {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.banner-account {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 2px;
}

/* ─── WO Cards ────────────────────────────────────────────────── */

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.wo-card {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    font-size: inherit;
}

.wo-card:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}

.wo-card.selected {
    border-color: var(--blue);
    background: var(--blue-light);
    box-shadow: 0 0 0 2px rgba(0, 103, 177, 0.2);
}

.wo-card-id {
    font-weight: 600;
    font-size: 0.88rem;
}

.wo-card-type {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

/* ─── Calendar ────────────────────────────────────────────────── */

.calendar {
    margin-bottom: 20px;
}

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

.cal-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.cal-nav {
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-nav:hover {
    background: var(--gray-100);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-header {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-400);
    padding: 4px 0;
    text-transform: uppercase;
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.cal-cell.empty {
    visibility: hidden;
}

.cal-cell.disabled {
    color: var(--gray-300);
}

.cal-cell.selectable {
    cursor: pointer;
    color: var(--gray-700);
}

.cal-cell.selectable:hover {
    background: var(--blue-light);
}

.cal-cell.selected {
    background: var(--blue);
    color: white;
    font-weight: 700;
}

.cal-cell.today {
    border: 2px solid var(--blue);
}

.cal-cell.today.selected {
    border-color: var(--blue-dark);
}

/* ─── Slots ───────────────────────────────────────────────────── */

.slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.slot-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

.slot-btn:hover:not(:disabled) {
    border-color: var(--blue);
}

.slot-btn.selected {
    border-color: var(--blue);
    background: var(--blue-light);
}

.slot-btn.full {
    background: var(--gray-50);
    border-color: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

.slot-time {
    font-weight: 600;
    font-size: 0.9rem;
}

.slot-avail {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.slot-btn.selected .slot-avail {
    color: var(--blue);
}

.slot-btn.full .slot-time,
.slot-btn.full .slot-avail {
    color: var(--gray-400);
}

/* ─── Confirmation ────────────────────────────────────────────── */

.confirmation {
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirmation h2 {
    margin-bottom: 20px;
}

.confirm-details {
    text-align: left;
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
}

.confirm-row:last-child {
    border-bottom: none;
}

.confirm-label {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.confirm-value {
    font-size: 0.88rem;
    font-weight: 600;
    text-align: right;
}

.confirm-note {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

.confirm-actions .btn {
    flex: 1;
}

/* ─── Info Panel (details/summary) ────────────────────────────── */

.info-panel {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin: 16px 0;
}

.info-panel-toggle {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--blue);
    list-style: none;
}

.info-panel-toggle::-webkit-details-marker { display: none; }

.info-panel-toggle::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 8px;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.info-panel[open] .info-panel-toggle::before {
    transform: rotate(90deg);
}

.info-panel-content {
    padding: 0 16px 16px;
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.info-panel-content ul {
    padding-left: 20px;
    margin: 8px 0;
}

.info-panel-content li {
    margin-bottom: 6px;
}

.info-panel-content a {
    color: var(--blue);
    text-decoration: none;
}

.expect-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.expect-summary ul {
    padding-left: 20px;
    margin: 6px 0 0;
}

.expect-summary li {
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.confirm-note a {
    color: var(--blue);
    text-decoration: none;
}

/* ─── Calendar Export ─────────────────────────────────────────── */

.export-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    width: auto;
}

.export-buttons .btn {
    width: auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* ─── Footer ──────────────────────────────────────────────────── */

.footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 16px 24px;
    text-align: center;
}

.footer p {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin: 2px 0;
}

.footer a {
    color: var(--blue);
    text-decoration: none;
}

/* ─── Accessibility ───────────────────────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cal-cell.selectable:focus {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 480px) {
    .header { padding: 12px 16px; }
    .main { padding: 16px 12px 32px; }
    .card { padding: 20px 16px; }
    .step-line { width: 32px; }
    .confirm-actions { flex-direction: column; }
}

/* ─── Landing panel ───────────────────────────────────────────── */

.landing-panel {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 0 16px;
}

.landing-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.landing-desc {
    color: var(--gray-600);
    margin-bottom: 28px;
    line-height: 1.6;
}

.landing-choices {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.landing-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    font-family: inherit;
}

.landing-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
}

.landing-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}

.landing-card-body {
    flex: 1;
}

.landing-card-body strong {
    display: block;
    font-size: 1rem;
    color: var(--blue);
    margin-bottom: 4px;
}

.landing-card-body p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.45;
}

.landing-card-arrow {
    font-size: 1.5rem;
    color: var(--gray-400);
    flex-shrink: 0;
}

/* ─── Radio grid (self-id form) ───────────────────────────────── */

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.radio-item:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}

.radio-item input[type="radio"] {
    accent-color: var(--blue);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.radio-item input[type="radio"]:checked + .radio-label-text {
    color: var(--blue);
    font-weight: 600;
}

.radio-label-text {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.field-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--gray-800);
    font-family: inherit;
    transition: border-color 0.15s;
}

.field-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 103, 177, 0.1);
}

/* ─── Photo upload (self-id) ──────────────────────────────────── */

.photo-input-hidden { display: none; }

.photo-category-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.photo-cat-btn {
    padding: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blue);
    background: white;
    border: 2px solid var(--blue);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.photo-cat-btn:hover:not(:disabled) {
    background: var(--blue-light);
}

.photo-cat-btn:active:not(:disabled) {
    background: var(--blue);
    color: white;
    transform: scale(0.97);
}

.photo-cat-btn:disabled {
    color: var(--gray-400);
    border-color: var(--gray-300);
    cursor: not-allowed;
}

.photo-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.photo-thumbnail {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.photo-remove:active { transform: scale(0.9); }

.photo-category-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.65);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-status-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-top: 8px;
}

.photo-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.photo-count-display {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 6px;
    text-align: center;
}

/* ─── Pipe type image cards ───────────────────────────────────── */

.pipe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.pipe-card {
    position: relative;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--gray-100);
}

.pipe-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pipe-card img {
    width: 100%;
    aspect-ratio: 3 / 1.2;
    object-fit: cover;
    display: block;
}

.pipe-card-label {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 4px;
    background: white;
    color: var(--gray-700);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pipe-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
}

.pipe-card:has(input:checked) {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 103, 177, 0.2);
}

.pipe-card:has(input:checked) .pipe-card-label {
    background: var(--blue);
    color: white;
}

.pipe-card-other {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background: var(--gray-100);
}

.pipe-card-other-icon {
    font-size: 2rem;
    color: var(--gray-400);
    line-height: 1;
    padding-top: 10px;
}
