/* =========================================================
   CITY MISSION
   COMPONENTS
   ========================================================= */


/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    min-height: 52px;

    padding: 14px 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #183153;
    border-radius: 6px;

    background: #ffffff;
    color: #183153;

    cursor: pointer;

    font-size: 0.8rem;
    font-weight: 800;

    letter-spacing: 0.1em;
    text-transform: uppercase;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.btn:hover {
    transform: translateY(-2px);

    box-shadow: 0 5px 0 #183153;
}

.btn-primary {
    background: #f45b4f;
    border-color: #f45b4f;

    color: #ffffff;
}

.btn-primary:hover {
    background: #e94d42;
    border-color: #e94d42;

    box-shadow: 0 5px 0 #183153;
}

.btn-large {
    width: 100%;

    min-height: 62px;

    font-size: 0.85rem;
}

button:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}

button:disabled:hover {
    transform: none;
}


/* =========================================================
   FORMS
   ========================================================= */
.setup-form {
    max-width: 600px;

    padding: 30px;

    background: #ffffff;

    border: 1px solid #e4ddd2;
    border-top: 5px solid #20a39e;
    border-radius: 8px;

    box-shadow:
        0 8px 24px rgba(24, 49, 83, 0.08);
}

.setup-form label,
.clue-card label {
    display: block;

    margin-bottom: 22px;

    color: #183153;

    font-size: 0.75rem;
    font-weight: 800;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}
input[type="text"] {
    width: 100%;
    min-height: 55px;

    margin-top: 8px;
    padding: 12px 15px;

    border: 1px solid #ccd7de;
    border-radius: 6px;

    outline: none;

    background: #f8fafb;
    color: #183153;

    font-size: 1rem;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

input[type="text"]::placeholder {
    color: #929eaa;
}

input[type="text"]:focus {
    background: #ffffff;

    border-color: #20a39e;

    box-shadow:
        0 0 0 3px rgba(32, 163, 158, 0.12);
}

.setup-form .btn {
    width: 100%;
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    margin-bottom: 25px;
    padding: 16px 18px;

    display: flex;
    flex-direction: column;

    gap: 3px;

    border: 1px solid #333842;

    font-size: 0.9rem;
}

/* ---------------------------------------------------------
   ERROR ALERT
   --------------------------------------------------------- */

.alert-error {
    margin-top: 0;
    padding: 16px 20px;

    display: flex;
    flex-direction: row;
    align-items: center;

    gap: 8px;

    background: #fff0ee;

    border: 1px solid #f4b8b2;
    border-left: 5px solid #f45b4f;
    border-radius: 6px;

    color: #8f3f39;
}

.alert-error strong {
    flex-shrink: 0;

    color: #d7463d;

    font-size: 0.75rem;
    font-weight: 900;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}
/* ---------------------------------------------------------
   SUCCESS ALERT
   --------------------------------------------------------- */

.alert-success {
    background: #eaf7f3;

    border: 1px solid #b8ded5;
    border-left: 5px solid #20a39e;
    border-radius: 6px;

    color: #37645f;
}

.alert-success strong {
    color: #16817d;

    font-weight: 900;
    letter-spacing: 0.06em;
}

/* =========================================================
   MISSION ERROR PAGE
   ========================================================= */

.mission-error-page {
    min-height: calc(100vh - 140px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 60px 20px;

    background: #fff8ed;
}


.mission-error-card {
    width: 100%;
    max-width: 620px;

    padding: 45px 35px;

    background: #ffffff;

    border: 1px solid #e4ddd2;
    border-top: 5px solid #f6c445;
    border-radius: 10px;

    text-align: center;

    box-shadow:
        0 15px 45px rgba(24, 49, 83, 0.10);
}


/* ---------------------------------------------------------
   ERROR LABEL
   --------------------------------------------------------- */

.mission-error-code {
    margin-bottom: 28px;

    color: #d98712;

    font-size: 0.7rem;
    font-weight: 900;

    letter-spacing: 0.2em;
    text-transform: uppercase;
}


/* ---------------------------------------------------------
   ERROR ICON
   --------------------------------------------------------- */

.mission-error-icon {
    width: 70px;
    height: 70px;

    margin: 0 auto 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff8ed;

    border: 2px solid #f6c445;
    border-radius: 50%;

    color: #d98712;

    font-size: 2rem;
    font-weight: 900;
}


/* ---------------------------------------------------------
   ERROR TEXT
   --------------------------------------------------------- */

.mission-error-card h1 {
    margin-bottom: 16px;

    color: #183153;

    font-size: clamp(2.2rem, 8vw, 3.6rem);
    line-height: 1;

    letter-spacing: -0.04em;
}


.mission-error-lead {
    margin-bottom: 10px;

    color: #41566d;

    font-size: 1.1rem;
}


.mission-error-text {
    max-width: 470px;

    margin: 0 auto 32px;

    color: #7b8997;

    font-size: 0.9rem;
    line-height: 1.7;
}


/* ---------------------------------------------------------
   ERROR ACTIONS
   --------------------------------------------------------- */

.mission-error-actions {
    display: grid;

    gap: 10px;
}


.mission-error-actions .btn {
    width: 100%;
}
/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 600px) {
    .clue-card {
        padding: 35px;
    }
    
    .mission-error-actions {
        grid-template-columns: 1fr 1fr;
    }

}


@media (min-width: 700px) {

    .btn-large {
        width: auto;

        min-width: 280px;
    }

}

/* =========================================================
   ACCOUNT / AUTH FORMS
   ========================================================= */

.account-page {
    max-width: 520px;
    margin: 50px auto;
    padding: 0 20px 60px;
}

.account-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.account-card h1 {
    margin: 0 0 8px;
    color: #183153;
    font-size: 2rem;
}

.account-intro {
    margin: 0 0 28px;
    color: #5c6675;
    line-height: 1.5;
}

.account-form .form-group {
    margin-bottom: 20px;
}

.account-form label {
    display: block;
    margin-bottom: 7px;
    color: #183153;
    font-weight: 700;
}

.account-form input {
    box-sizing: border-box;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    background: #fff;
    color: #183153;
    font: inherit;
    font-size: 1rem;
}

.account-form input:focus {
    outline: none;
    border-color: #183153;
    box-shadow: 0 0 0 3px rgba(24, 49, 83, 0.10);
}

.account-form small {
    display: block;
    margin-top: 6px;
    color: #777;
}

.account-form .btn {
    width: 100%;
    margin-top: 6px;
}

.account-link {
    margin: 24px 0 0;
    text-align: center;
    color: #5c6675;
}

.account-link a {
    color: #183153;
    font-weight: 700;
}

.error-message {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff0f0;
    border: 1px solid #f45b4f;
    color: #9e2921;
    font-weight: 600;
}

@media (max-width: 600px) {
    .account-page {
        margin-top: 25px;
    }

    .account-card {
        padding: 24px 20px;
    }
}

/* =========================================================
   SITE NAVIGATION
   ========================================================= */

.site-header {
    display: flex;
    align-items: center;
    gap: 28px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.site-nav a {
    color: #183153;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.site-nav a:hover {
    color: #f45b4f;
}

.nav-user {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
}

.site-nav .nav-register {
    padding: 9px 14px;
    background: #f45b4f;
    color: #ffffff;
    border-radius: 6px;
}

.site-nav .nav-register:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.site-nav .nav-logout {
    color: #6b7280;
}

.header-location {
    margin-left: 10px;
}

/* =========================================================
   MOBILE NAVIGATION
   ========================================================= */

@media (max-width: 700px) {

    .site-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-location {
        margin-left: auto;
    }

    /*
     * Hide "Welcome Rob!" on mobile.
     * The user already knows they're logged in.
     */
    .nav-user {
        display: none;
    }

    /*
     * Put the three useful actions on their own row.
     */
    .site-nav {
        order: 3;

        width: 100%;
        margin-left: 0;
        padding-top: 12px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 12px;

        border-top: 1px solid #e5e7eb;
    }

    .site-nav a {
        font-size: 0.82rem;
        white-space: nowrap;
    }

}

/* =========================================================
   MY MISSIONS
   ========================================================= */

.my-missions-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 70px;
}

.my-missions-heading {
    margin-bottom: 24px;
}

.my-missions-heading h1 {
    margin: 0 0 6px;
    color: #183153;
    font-size: 2rem;
}

.my-missions-heading p {
    margin: 0;
    color: #687385;
}


/* =========================================================
   FILTERS
   ========================================================= */

.mission-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
}

.mission-filters a {
    padding: 9px 16px;
    border: 1px solid #d8dee7;
    border-radius: 20px;
    color: #183153;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.mission-filters a:hover {
    border-color: #183153;
}

.mission-filters a.active {
    background: #183153;
    border-color: #183153;
    color: #ffffff;
}


/* =========================================================
   GRID
   ========================================================= */

.my-missions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}


/* =========================================================
   CARD
   ========================================================= */

.my-mission-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e3e7ed;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
}

.my-mission-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.my-mission-code {
    color: #687385;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.my-mission-card h2 {
    margin: 0 0 10px;
    color: #183153;
    font-size: 1.25rem;
    line-height: 1.25;
}

.my-mission-description {
    flex-grow: 1;
    margin: 0 0 20px;
    color: #687385;
    line-height: 1.5;
}


/* =========================================================
   STATUS
   ========================================================= */

.mission-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mission-status-active {
    background: #fff1df;
    color: #9a5800;
}

.mission-status-completed {
    background: #e7f5ec;
    color: #247143;
}


/* =========================================================
   META
   ========================================================= */

.my-mission-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #edf0f4;
}

.my-mission-meta div {
    min-width: 0;
}

.my-mission-meta span {
    display: block;
    margin-bottom: 3px;
    color: #8a929e;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.my-mission-meta strong {
    color: #183153;
    font-size: 0.88rem;
}


/* =========================================================
   ACTIONS
   ========================================================= */

.my-mission-actions {
    margin-top: 18px;
}

.my-mission-actions .btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.no-photos {
    display: block;
    padding: 11px;
    text-align: center;
    color: #8a929e;
    font-size: 0.9rem;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.mission-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
}

.mission-pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid #d8dee7;
    border-radius: 7px;
    color: #183153;
    text-decoration: none;
    font-weight: 700;
}

.mission-pagination a:hover {
    border-color: #183153;
}

.mission-pagination a.active {
    background: #183153;
    border-color: #183153;
    color: #ffffff;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.my-missions-empty {
    padding: 55px 25px;
    background: #ffffff;
    border: 1px solid #e3e7ed;
    border-radius: 14px;
    text-align: center;
}

.my-missions-empty h2 {
    margin-top: 0;
    color: #183153;
}

.my-missions-empty p {
    margin-bottom: 24px;
    color: #687385;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .my-missions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .my-missions-page {
        padding: 30px 16px 50px;
    }

    .my-missions-grid {
        grid-template-columns: 1fr;
    }

    .mission-filters {
        overflow-x: auto;
    }

    .mission-filters a {
        white-space: nowrap;
    }

}

/* =========================================================
   DELETE MISSION
   ========================================================= */

.my-mission-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-delete {
    width: 100%;
    background: transparent;
    border: 1px solid #d7dce3;
    color: #8a3b36;
}

.btn-delete:hover {
    border-color: #b9443b;
    color: #b9443b;
}


/* =========================================================
   DELETE MODAL
   ========================================================= */

.delete-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.delete-modal.is-open {
    display: flex;
}

.delete-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 35, 0.65);
}

.delete-modal-dialog {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 480px;

    padding: 30px;

    background: #ffffff;
    border-radius: 14px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.delete-modal-dialog h2 {
    margin: 0 0 16px;
    color: #183153;
}

.delete-modal-dialog p {
    color: #687385;
    line-height: 1.5;
}

.delete-mission-name {
    color: #183153 !important;
    font-weight: 800;
    font-size: 1.1rem;
}

.delete-modal-close {
    position: absolute;
    top: 12px;
    right: 15px;

    border: 0;
    background: transparent;

    color: #687385;

    font-size: 1.8rem;
    line-height: 1;

    cursor: pointer;
}

.delete-modal-dialog input {
    box-sizing: border-box;
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #cfd6df;
    border-radius: 8px;

    font: inherit;
}

.delete-modal-dialog label {
    display: block;
    margin-bottom: 7px;

    color: #183153;
    font-weight: 700;
}

.delete-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;

    margin-top: 22px;
}

.btn-delete-confirm {
    border: 1px solid #b9443b;
    background: #b9443b;
    color: #ffffff;
}

.btn-delete-confirm:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.mission-card-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mission-progress-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border-radius: 50%;

    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.mission-progress-completed {
    background: #28a745;
    color: #fff;
}

.mission-progress-active {
    background: #dc3545;
    color: #fff;
}

/* =========================================================
   BACK TO TOP
   ========================================================= */

.site-footer {
    position: relative;
}

.back-to-top {
    position: absolute;
    right: 20px;
    bottom: 20px;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #f45b4f;
    color: #fff;

    font-size: 24px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.back-to-top:hover {
    transform: translateY(-2px);
}

.back-to-top:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 600px) {

    .back-to-top {
        right: 14px;
        bottom: 14px;

        width: 40px;
        height: 40px;
    }

}

.mission-gallery-spoiler-note {
    margin-top: 6px;
    font-size: 13px;
    color: #999;
    font-style: italic;
}