:root {
    --app-bg: #f6f8fb;
    --app-primary: #0d6efd;
}

body {
    background: var(--app-bg);
}

.guest-bg {
    background: radial-gradient(circle at top left, rgba(13, 110, 253, .14), transparent 30%), #f8fafc;
}

.card, .alert, .list-group {
    border-radius: 1rem;
}

.skill-card {
    transition: transform .18s ease, box-shadow .18s ease;
}

.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .12) !important;
}

.empty-state {
    background: #fff;
    border: 1px dashed rgba(13, 110, 253, .25);
    color: #6c757d;
}

.avatar-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    font-weight: 800;
    font-size: 2rem;
}

.profile-card {
    top: 5rem;
}

.notification-unread {
    background: #eef5ff;
}

.badge.text-bg-light {
    color: #334155 !important;
}

.avatar-sm {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
    flex: 0 0 44px;
}

/* My confirmations: keep the history readable on small screens. */
@media (max-width: 575.98px) {
    .confirmations-history-wrap {
        background: transparent;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible;
    }

    .confirmations-history-table,
    .confirmations-history-table thead,
    .confirmations-history-table tbody,
    .confirmations-history-table th,
    .confirmations-history-table td,
    .confirmations-history-table tr {
        display: block;
        width: 100%;
    }

    .confirmations-history-table thead {
        display: none;
    }

    .confirmations-history-table tbody {
        display: grid;
        gap: 1rem;
    }

    .confirmations-history-table tr.confirmation-history-row {
        background: #fff;
        border: 1px solid rgba(15, 23, 42, .08);
        border-radius: 1rem;
        box-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .06);
        padding: .9rem;
    }

    .confirmations-history-table td {
        border: 0;
        padding: .45rem 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .2rem;
        white-space: normal;
        word-break: break-word;
    }

    .confirmations-history-table td::before {
        content: attr(data-label);
        font-size: .75rem;
        font-weight: 700;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .confirmations-history-table td:first-child {
        padding-top: 0;
    }

    .confirmations-history-table td:first-child::before {
        display: none;
    }

    .confirmation-skill-title {
        font-size: 1.05rem;
        line-height: 1.3;
    }

    .confirmation-labels {
        line-height: 1.65;
    }

    .confirmation-note {
        line-height: 1.5;
    }

    .confirmation-actions {
        width: 100%;
        justify-content: stretch !important;
        flex-direction: column;
    }

    .confirmation-actions .btn,
    .confirmation-actions form,
    .confirmation-actions form .btn {
        width: 100%;
    }
}

/* Reviews page: stack skill-confirmation details clearly on small screens. */
.review-again-title,
.review-again-value,
.review-again-tags {
    overflow-wrap: anywhere;
}

.review-again-detail + .review-again-detail {
    margin-top: .75rem;
}

.review-again-label {
    display: block;
    font-size: .76rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .2rem;
}

.review-again-value {
    display: block;
}

@media (max-width: 575.98px) {
    .review-again-card .card-body {
        padding: 1rem !important;
    }

    .review-again-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .review-again-badge {
        align-self: flex-start;
    }

    .review-again-detail {
        padding: .7rem 0;
        border-top: 1px solid rgba(15, 23, 42, .08);
    }

    .review-again-details .review-again-detail:first-child {
        border-top: 0;
        padding-top: 0;
    }

    .review-again-tags {
        line-height: 1.65;
    }

    .review-again-actions {
        flex-direction: column;
        width: 100%;
    }

    .review-again-actions .btn,
    .review-again-profile-btn {
        width: 100%;
    }
}


/* Friendly custom selector for security questions. */
.custom-question-selector {
    position: relative;
}

.custom-question-selector-toggle {
    background: #fff;
    cursor: pointer;
}

.custom-question-selector-toggle:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.custom-question-selector-menu {
    display: none;
    position: absolute;
    z-index: 1050;
    top: calc(100% + .35rem);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: .9rem;
    padding: .35rem;
}

.custom-question-selector.is-open .custom-question-selector-menu {
    display: grid;
    gap: .2rem;
}

.custom-question-option {
    border: 0;
    background: transparent;
    text-align: left;
    border-radius: .65rem;
    padding: .65rem .75rem;
    color: #1f2937;
}

.custom-question-option:hover,
.custom-question-option:focus {
    background: #eef5ff;
    outline: none;
}

.terms-text {
    max-height: 420px;
    overflow-y: auto;
}

/* Security-header friendly utility classes: avoid inline style attributes. */
.terms-text {
    white-space: pre-line;
}

.frozen-page {
    min-height: 100vh;
}

.frozen-card {
    max-width: 620px;
}

/* Prevent accidental double submissions on POST actions. */
button.is-submitting,
input[type="submit"].is-submitting {
    cursor: wait;
    pointer-events: none;
}

.dashboard-tabs .nav-link {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    font-weight: 700;
}

.dashboard-tab-content .card.rounded-top-0 {
    border-top-left-radius: 0 !important;
}

.dashboard-friendly-guide {
    line-height: 1.55;
}

.skill-description a,
.profile-card p a,
.review-again-value a,
.note-with-links a {
    overflow-wrap: anywhere;
}


/* Friendly guide after accepting terms. */
.security-questions-card {
    transition: box-shadow .35s ease, transform .35s ease;
}

.security-questions-focus {
    animation: securityQuestionsPulse 1.4s ease-in-out 1;
    box-shadow: 0 1rem 2.5rem rgba(13, 110, 253, .18) !important;
}

@keyframes securityQuestionsPulse {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.015);
    }
    100% {
        transform: scale(1);
    }
}

.note-with-links a {
    overflow-wrap: anywhere;
}

/* Accessibility and PWA polish */
.skip-link{position:absolute;left:-999px;top:auto;width:1px;height:1px;overflow:hidden;z-index:2000}
.skip-link:focus{left:1rem;top:1rem;width:auto;height:auto;background:#fff;color:#080d1a;padding:.65rem 1rem;border-radius:.75rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.15)}
:focus-visible{outline:3px solid #00aaff;outline-offset:2px}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}


/* PWA install button */
.pwa-install-btn {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    border-radius: 999px;
    padding: .65rem 1rem;
    font-weight: 700;
}

.pwa-install-btn[hidden] {
    display: none !important;
}

@media (max-width: 575.98px) {
    .pwa-install-btn {
        left: 1rem;
        right: 1rem;
        width: calc(100% - 2rem);
    }
}
