/* =============================================================================
   SunriseService theme
   The whole palette is drawn from the Sunrise Window & Door Systems logo:
   its golden sun + black lettering on white.
   ============================================================================= */

:root {
    /* Logo colors */
    --sun-gold:        #F2A71B;   /* the sun */
    --sun-gold-dark:   #CF8C0E;   /* hover / borders */
    --sun-gold-deep:   #A96F06;   /* pressed */
    --sun-gold-tint:   #FDF3DD;   /* pale wash for banners/hovers */
    --sun-black:       #161616;   /* the lettering */
    --sun-paper:       #FFFDF8;   /* warm near-white page background */
    --sun-border:      #EFE4CB;   /* soft warm border */
}

/* ------------------------------- base ------------------------------------ */

html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--sun-paper);
    color: var(--sun-black);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

main {
    flex: 1 0 auto;
}

/* Headings echo the logo's bold geometric lettering */
h1, h2, h3, .brand-name, .stat-number {
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 700;
}

/* On iOS, inputs smaller than 16px make Safari zoom the page when focused -
   16px keeps the mobile experience steady. */
input.form-control,
select.form-select,
textarea.form-control {
    font-size: 16px;
}

.min-w-0 { min-width: 0; }

.req { color: #c0392b; }

/* ------------------------------ navbar ----------------------------------- */

.sunrise-navbar {
    border-bottom: 1px solid var(--sun-border);
}

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

.brand-name {
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: var(--sun-black);
}

.brand-accent { color: var(--sun-gold-dark); }

.sunrise-navbar .nav-link {
    font-weight: 600;
    color: var(--sun-black);
}

.sunrise-navbar .nav-link:hover,
.sunrise-navbar .nav-link:focus {
    color: var(--sun-gold-dark);
}

/* The signature element: a thin "sunrise ray" gradient under the header */
.sunrise-ray {
    height: 4px;
    background: linear-gradient(90deg,
        var(--sun-gold-deep) 0%,
        var(--sun-gold) 35%,
        #FFD37A 60%,
        var(--sun-gold) 100%);
}

/* ------------------------------ buttons ---------------------------------- */

.btn-sunrise {
    --bs-btn-bg: var(--sun-gold);
    --bs-btn-border-color: var(--sun-gold-dark);
    --bs-btn-color: var(--sun-black);
    --bs-btn-hover-bg: var(--sun-gold-dark);
    --bs-btn-hover-border-color: var(--sun-gold-deep);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-bg: var(--sun-gold-deep);
    --bs-btn-active-border-color: var(--sun-gold-deep);
    --bs-btn-active-color: #ffffff;
    font-weight: 600;
}

.bg-sunrise { background-color: var(--sun-gold) !important; }
.text-sunrise { color: var(--sun-gold-dark) !important; }

.sunrise-link {
    color: var(--sun-gold-deep);
    text-decoration-color: var(--sun-gold);
}
.sunrise-link:hover { color: var(--sun-gold-dark); }

/* Gold focus rings tie the forms to the brand */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--sun-gold);
    box-shadow: 0 0 0 0.25rem rgba(242, 167, 27, 0.25);
}

.form-check-input:checked {
    background-color: var(--sun-gold);
    border-color: var(--sun-gold-dark);
}

/* ------------------------------- cards ----------------------------------- */

.sunrise-card {
    border: 1px solid var(--sun-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(22, 22, 22, 0.05);
    background: #ffffff;
}

/* Gold-edged variant - highlights the technician's "My work" card */
.border-sunrise {
    border-color: var(--sun-gold) !important;
}

.service-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.service-card:hover {
    box-shadow: 0 6px 18px rgba(22, 22, 22, 0.10);
    transform: translateY(-2px);
}

/* --------------------------- auth screens --------------------------------- */

.auth-wrap { max-width: 440px; }
.auth-logo { max-width: 190px; height: auto; }

/* --------------------------- landing page --------------------------------- */

.home-logo { max-width: 220px; height: auto; }

.action-card {
    background: #ffffff;
    border: 1px solid var(--sun-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--sun-black);
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.action-card:hover,
.action-card:focus-visible {
    color: var(--sun-black);
    border-color: var(--sun-gold);
    box-shadow: 0 8px 22px rgba(242, 167, 27, 0.25);
    transform: translateY(-3px);
}

.action-icon {
    font-size: 2.4rem;
    line-height: 1;
    color: var(--sun-gold-dark);
    margin-bottom: 0.5rem;
}

.stat-tile {
    background: var(--sun-gold-tint);
    border: 1px solid var(--sun-border);
    border-radius: 0.75rem;
    text-align: center;
    padding: 0.75rem 0.25rem;
}

.stat-number { font-size: 1.5rem; line-height: 1.2; }
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c6248;
}

/* ---------------------------- status badges ------------------------------- */

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    background: #eee;               /* fallback for custom statuses */
    color: var(--sun-black);
    border: 1px solid rgba(0,0,0,0.08);
}

.status-new              { background: var(--sun-gold);   color: var(--sun-black); }
.status-in-progress      { background: #cfe2ff;           color: #084298; }
.status-waiting-on-parts { background: #fff3cd;           color: #664d03; }
.status-scheduled        { background: #e2d9f3;           color: #3d2a66; }
.status-completed        { background: #d1e7dd;           color: #0f5132; }
.status-cancelled        { background: #f8d7da;           color: #842029; }

/* Technician work statuses (New / Working / Finished).
   "New" reuses .status-new above. */
.status-working          { background: #cfe2ff;           color: #084298; }
.status-finished         { background: #d1e7dd;           color: #0f5132; }

/* ------------------------------- photos ----------------------------------- */

/* Thumbnails: real image shrunk via CSS. object-fit keeps the tile tidy;
   tapping opens the lightbox where the ENTIRE image is visible. */
.photo-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--sun-border);
    cursor: zoom-in;
    background: #f3f3f3;
    display: block;
}

.photo-tile { position: relative; }

.btn-delete-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    line-height: 1;
    border: none;
    border-radius: 50%;
    background: rgba(22, 22, 22, 0.72);
    color: #ffffff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-delete-photo:hover { background: #b02a37; }

/* Small square thumbnail (or placeholder) on the Check Service list cards */
.list-thumb {
    width: 72px;
    height: 72px;
    aspect-ratio: auto;
    flex: 0 0 72px;
}

.list-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--sun-border);
    border-radius: 0.5rem;
    color: #c9b98d;
    font-size: 1.6rem;
    background: var(--sun-gold-tint);
}

.notes-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Lightbox: the full image, whole, centered, never cropped */
.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Upload previews on the New Service page */
.preview-tile img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--sun-border);
}
.preview-tile .preview-name {
    font-size: 0.7rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------------------ details ----------------------------------- */

.detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a7a55;
    font-weight: 700;
}

/* Keeps user line breaks; Razor encoding keeps it XSS-safe */
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* The "picture box" for the product's window drawing.
   The server already renders an exact 400 x 400 pixel PNG; these rules give
   it a 400px frame on desktop that shrinks (still square, via aspect-ratio)
   on phones narrower than 400px. object-fit:contain also keeps the raw-bytes
   fallback (non-Windows hosting) undistorted inside the square. */
.window-image {
    width: 400px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--sun-border);
    border-radius: 0.5rem;
    background: #ffffff;
}

/* Banner shown on New Service when the Product ID came from a scanned label */
.sunrise-scan-banner {
    background: var(--sun-gold-tint);
    border-left: 4px solid var(--sun-gold) !important;
    color: var(--sun-black);
}

/* ------------------------------- footer ----------------------------------- */

.sunrise-footer {
    border-top: 1px solid var(--sun-border);
    background: #ffffff;
}

/* --------------------------- char counters -------------------------------- */

.char-counter {
    font-size: 0.72rem;
    color: #8a8a8a;
    text-align: right;
}
.char-counter.near-limit { color: #b02a37; font-weight: 600; }

/* ------------------------------ mobile ------------------------------------ */

@media (max-width: 575.98px) {
    /* Bigger touch targets for gloved/field use */
    .btn { padding-top: 0.55rem; padding-bottom: 0.55rem; }
    .brand-logo { height: 34px; }
    .brand-name { font-size: 1rem; }
}

/* Respect users who turned animations off in their OS */
@media (prefers-reduced-motion: reduce) {
    .service-card, .action-card { transition: none; }
    .service-card:hover, .action-card:hover { transform: none; }
}
