/* ==========================================================================
   APAD Public Ticket Pages — self-contained, no build step.
   Loaded via <link> in resources/views/public/*.blade.php
   ========================================================================== */

:root {
    --apad-primary: #0B3C8C;
    --apad-dark: #061d4a;
    --apad-light: #1e5bbf;
    --apad-accent: #f59e0b;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --green-50: #f0fdf4;
    --green-200: #bbf7d0;
    --green-700: #15803d;
    --red-50: #fef2f2;
    --red-200: #fecaca;
    --red-700: #b91c1c;
    --amber-50: #fffbeb;
    --amber-200: #fde68a;
    --amber-700: #b45309;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--slate-100);
    color: var(--slate-800);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
a { color: var(--apad-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ----- Page header band ----- */
.page-header {
    background: linear-gradient(135deg, #061d4a 0%, #0B3C8C 50%, #1e5bbf 100%);
    color: #fff;
    padding: 2.5rem 1.5rem 4.5rem;
    text-align: center;
}
.page-header img { margin: 0 auto 1rem; height: 3rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.page-header p  { font-size: 0.875rem; color: rgba(255, 255, 255, 0.85); max-width: 36rem; margin: 0 auto; }

/* ----- Page container ----- */
.page-container {
    max-width: 720px;
    margin: -3rem auto 3rem;
    padding: 0 1.25rem;
}
.card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(6, 29, 74, 0.12);
    padding: 2rem;
}
.card-section { padding: 1.25rem 0; border-top: 1px solid var(--slate-200); }
.card-section:first-child { border-top: 0; padding-top: 0; }
.card-section:last-child { padding-bottom: 0; }
.card h2 {
    font-size: 1.125rem; font-weight: 600; color: var(--slate-900); margin-bottom: 1rem;
}

/* ----- Alerts ----- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.alert-success { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-200); }
.alert-error { background: var(--red-50); color: var(--red-700); border: 1px solid var(--red-200); }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.error-list { list-style: disc; margin-left: 1.25rem; }

/* ----- Form ----- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { display: block; }
.form-group--full { grid-column: 1 / -1; }
.form-label {
    display: block; font-size: 0.875rem; font-weight: 500; color: var(--slate-700);
    margin-bottom: 0.375rem;
}
.required { color: #dc2626; margin-left: 2px; }
.form-input, .form-select, .form-textarea {
    display: block; width: 100%;
    border: 1px solid var(--slate-300); border-radius: 0.5rem;
    background: #fff;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem; font-family: inherit;
    color: var(--slate-900);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-textarea { min-height: 8rem; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--apad-primary);
    box-shadow: 0 0 0 3px rgba(11, 60, 140, 0.15);
}
.form-helper { font-size: 0.75rem; color: var(--slate-500); margin-top: 0.375rem; }

/* honeypot — visually hidden but in DOM */
.hp { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

/* captcha */
.captcha-row { display: flex; align-items: center; gap: 1rem; }
.captcha-question {
    background: var(--slate-100); padding: 0.625rem 1rem; border-radius: 0.5rem;
    font-size: 0.95rem; color: var(--slate-700); white-space: nowrap;
}
.captcha-row .form-input { width: 6rem; }

/* file input */
.form-file {
    display: block; width: 100%;
    padding: 0.5rem;
    border: 1px dashed var(--slate-300); border-radius: 0.5rem;
    background: var(--slate-50);
    font-size: 0.875rem;
}

/* buttons */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: var(--apad-primary);
    color: #fff;
    padding: 0.7rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem; font-weight: 600;
    transition: background 0.15s;
    width: 100%;
}
.btn-primary:hover { background: var(--apad-dark); }
.btn-secondary {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: var(--apad-primary);
    font-size: 0.875rem; font-weight: 500;
    padding: 0.4rem 0;
}
.btn-secondary:hover { color: var(--apad-dark); }

/* ----- Status badges (track page) ----- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-open       { background: #dbeafe; color: #1d4ed8; }
.badge-progress   { background: #fef3c7; color: #92400e; }
.badge-pending    { background: #f3e8ff; color: #6b21a8; }
.badge-resolved   { background: #dcfce7; color: #166534; }
.badge-closed     { background: var(--slate-200); color: var(--slate-700); }
.badge-cancelled  { background: var(--red-50); color: var(--red-700); }

/* ----- Ticket meta ----- */
.ticket-meta {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.625rem;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
}
@media (max-width: 640px) { .ticket-meta { grid-template-columns: 1fr; } }
.ticket-meta dt {
    font-size: 0.7rem; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 0.125rem;
}
.ticket-meta dd { font-size: 0.875rem; color: var(--slate-900); font-weight: 500; }

/* ----- Timeline ----- */
.timeline { display: flex; flex-direction: column; gap: 1rem; }
.timeline-item {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}
.timeline-item--mine {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.timeline-meta {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.75rem; color: var(--slate-500);
    margin-bottom: 0.5rem;
}
.timeline-author { font-weight: 600; color: var(--slate-700); }
.timeline-body { font-size: 0.95rem; line-height: 1.6; color: var(--slate-800); white-space: pre-wrap; }

.timeline-empty {
    text-align: center; padding: 2rem 1rem;
    color: var(--slate-500); font-size: 0.875rem;
}

/* ----- Attachments ----- */
.attachments { display: flex; flex-direction: column; gap: 0.5rem; }
.attachment {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}
.attachment .name { font-weight: 500; color: var(--slate-800); flex: 1; }
.attachment .size { color: var(--slate-500); font-size: 0.75rem; }

/* ticket-number copy helper */
.copy-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--slate-300);
    border-radius: 9999px;
    padding: 0.2rem 0.55rem;
    background: #fff;
    color: var(--apad-primary);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}
.copy-button:hover {
    background: var(--slate-50);
    text-decoration: none;
}
.copy-button--light {
    margin-left: 0.35rem;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.copy-button--light:hover {
    background: rgba(255, 255, 255, 0.2);
}
