/* ==========================================================================
   Skills Provision – Secure Share Platform
   Brand-aligned stylesheet — matches skills-provision.com
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Raleway:wght@500;600;700&display=swap');

/* --- Reset & Base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    color: #444;
    background: #f4f6f9;
    line-height: 1.6;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: #428bca; text-decoration: none; }
a:hover { color: #4169a8; text-decoration: none; }

/* --- Layout -------------------------------------------------------------- */
.wrapper {
    max-width: 980px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2rem;
    flex: 1;
    width: 100%;
}

/* --- Header -------------------------------------------------------------- */
#header {
    background: #4169a8;
    padding: 5px 0 0;
    width: 100%;
    z-index: 997;
    box-shadow: 0 0 20px 0 rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
}

.header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    max-height: 90px;
    object-fit: contain;
    display: block;
}

.header-right {
    flex: 1;
    min-width: 0;
}

.header-logout-row {
    text-align: right;
    margin-bottom: 4px;
}

.header-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
}

.header-nav a {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    padding: 7px 9px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    transition: 0.3s;
    border-radius: 6px;
    white-space: nowrap;
}

.header-nav a:hover,
.header-nav a:focus {
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.header-logout-btn {
    display: inline-block;
    background: #be0900;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 21px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
    margin-left: 6px;
    white-space: nowrap;
}

.header-logout-btn:hover {
    background: #001343 !important;
    box-shadow: none;
}

/* --- Flash Messages ------------------------------------------------------ */
.flash-error {
    background: #fdecea;
    color: #be0900;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid #be0900;
    font-size: 14px;
}

.flash-success {
    background: #e8f5e9;
    color: #006400;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid #006400;
    font-size: 14px;
}

/* --- Typography ---------------------------------------------------------- */
h2, h3, h4 {
    font-family: 'Raleway', sans-serif;
}

h2 {
    color: #333;
    font-weight: 600;
    font-size: 1.4rem;
    margin: 0.25rem 0 0.75rem;
}

h3 {
    color: #333;
    font-weight: 600;
    font-size: 1.05rem;
}

/* --- Cards --------------------------------------------------------------- */
.card {
    background: #fff;
    border-radius: 6px;
    padding: 1.15rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #4169a8;
}

/* --- Tables -------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

th, td {
    border: 1px solid #ddd;
    padding: 0.55rem 0.7rem;
    text-align: left;
    font-size: 0.88rem;
}

th {
    background: #4169a8;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Pagination ---------------------------------------------------------- */
.pagination {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
}
.pagination a {
    background: #4169a8;
    color: #fff;
}
.pagination a:hover {
    background: #001343;
}
.pagination .current {
    background: #001343;
    color: #fff;
    font-weight: 700;
}
.pagination .disabled {
    color: #aaa;
    cursor: default;
}

/* --- Forms --------------------------------------------------------------- */
form.inline { display: inline; }

label {
    display: block;
    margin: 0.75rem 0 0.3rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #333;
}

label:first-child,
form > label:first-of-type,
.card > form > label:first-of-type {
    margin-top: 0;
}

label small {
    font-weight: 400;
    color: #888;
    font-size: 0.82rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    display: block;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 480px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4169a8;
    box-shadow: 0 0 0 3px rgba(65,105,168,0.15);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23666' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}

textarea {
    min-height: 90px;
    resize: vertical;
    max-width: 600px;
}

input[type="file"] {
    display: block;
    padding: 0.5rem;
    border: 2px dashed #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 480px;
    font-size: 14px;
    font-family: inherit;
    color: #555;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

input[type="file"]:hover,
input[type="file"]:focus {
    border-color: #4169a8;
    background: #f0f4fa;
}

input[type="file"]::file-selector-button {
    padding: 0.35rem 0.85rem;
    margin-right: 0.75rem;
    border: none;
    border-radius: 4px;
    background: #4169a8;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: #001343;
}

/* Checkbox / Radio groups */
.check-group {
    margin: 0.45rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.check-group label {
    display: inline;
    font-weight: 400;
    margin: 0;
    cursor: pointer;
    user-select: none;
    color: #444;
}

.check-group input[type="checkbox"],
.check-group input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: #4169a8;
    cursor: pointer;
    flex-shrink: 0;
}

/* Side-by-side field pairs */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
    max-width: 480px;
}

.form-row input,
.form-row select,
.form-row textarea {
    max-width: 100%;
}

/* Submit / action area */
form > button[type="submit"],
.form-actions {
    margin-top: 1.35rem;
}

.form-actions {
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Buttons ------------------------------------------------------------- */
button,
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 700;
    background: linear-gradient(to bottom, #4169a8 0%, #4c8ec4 100%);
    color: #fff;
    transition: background 0.2s, box-shadow 0.2s;
    text-decoration: none;
    line-height: 1.4;
    border-bottom: 1px solid #3b6a9c;
}

button:hover,
.btn:hover {
    background: linear-gradient(to bottom, #50b6df 10%, #2792cc 75%);
    box-shadow: 0 2px 6px rgba(65,105,168,0.3);
    color: #fff;
    text-decoration: none;
}

.btn-danger {
    background: linear-gradient(to bottom, #d61d00 10%, #9b0300 75%);
    border-bottom-color: #7a0200;
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #e02d12 10%, #a80603 75%);
    box-shadow: 0 2px 6px rgba(190,9,0,0.3);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    color: #4169a8;
    border: 1px solid #4169a8;
}

.btn-outline:hover {
    background: #4169a8;
    color: #fff;
    box-shadow: none;
}

/* --- Command Buttons ----------------------------------------------------- */
.cmd-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #4169a8;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.cmd-btn:hover {
    background: #f0f5fc;
    border-color: #001343;
    box-shadow: 0 2px 8px rgba(65,105,168,0.15);
    text-decoration: none;
    color: #333;
}
.cmd-btn-body {
    flex: 1;
    min-width: 0;
}
.cmd-btn-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #001343;
}
.cmd-btn:hover .cmd-btn-title {
    color: #4169a8;
}
.cmd-btn-desc {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.15rem;
}
.cmd-btn-arrow {
    font-size: 1.25rem;
    color: #4169a8;
    margin-left: 0.75rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.cmd-btn:hover .cmd-btn-arrow {
    transform: translateX(3px);
}

/* --- Grid System --------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* --- Stats --------------------------------------------------------------- */
.stat {
    text-align: center;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat .num {
    font-size: 2rem;
    font-weight: 700;
    color: #4169a8;
    line-height: 1.1;
}

.stat .lbl {
    font-size: 0.82rem;
    color: #888;
    margin-top: 0.15rem;
    margin-bottom: 0.5rem;
}

/* --- Progress Bar -------------------------------------------------------- */
.progress-bar {
    background: #e0e4ea;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    width: 100%;
    max-width: 140px;
}

.progress-bar .fill {
    background: linear-gradient(90deg, #4169a8, #4c8ec4);
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 10px;
}

/* --- Score Pill ---------------------------------------------------------- */
.score-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #6c757d;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-pill--green {
    background: #006400;
}

/* --- Utilities ----------------------------------------------------------- */
.muted { color: #888; font-size: 14px; }

.empty-state {
    color: #999;
    font-style: italic;
    padding: 0.5rem 0;
    font-size: 14px;
}

/* --- Login / Register (standalone pages) --------------------------------- */
.auth-page {
    margin: 0;
    background: #4169a8;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-box {
    background: #fff;
    padding: 2.25rem 2rem;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-logo img {
    max-height: 100px;
    object-fit: contain;
}

.auth-box h1 {
    margin-top: 0;
    margin-bottom: 0.15rem;
    color: #4169a8;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
}

.auth-box .subtitle {
    color: #888;
    font-size: 0.78rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-box label {
    margin: 0.7rem 0 0.2rem;
}

.auth-box input[type="text"],
.auth-box input[type="email"],
.auth-box input[type="password"] {
    max-width: 100%;
    margin-bottom: 0.35rem;
}

.auth-box button {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 15px;
    margin-top: 0.75rem;
}

.auth-box .alt-link {
    text-align: center;
    margin-top: 1.1rem;
    font-size: 13px;
    color: #888;
}

.auth-box .alt-link a {
    color: #428bca;
    font-weight: 600;
}

/* --- Footer -------------------------------------------------------------- */
#footer {
    background: #4169a8;
    padding: 45px 0 30px;
    margin-top: auto;
    width: 100%;
}

.footer-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    padding-bottom: 25px;
}

.footer-logo {
    text-align: center;
}

.footer-logo img {
    max-width: 220px;
    height: auto;
}

.footer-social {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-social a {
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid #fff;
    border-radius: 6px;
}

.footer-social a svg {
    display: block;
}

.footer-social a:hover {
    color: #fca600;
    border-color: #fca600;
}

.footer-copy {
    text-align: center;
    color: #fff;
    font-size: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
}

.footer-copy p {
    margin: 0 0 8px;
    line-height: 1.8;
}

.footer-copy a {
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: 0.3s;
}

.footer-copy a:hover {
    color: #fca600;
}

.footer-copyright {
    margin-top: 12px;
    font-size: 12px;
    opacity: 0.75;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 700px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .header-inner {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .header-logout-row {
        text-align: center;
    }

    .header-nav {
        justify-content: center;
    }

    .header-nav a {
        font-size: 12px;
        padding: 6px 6px;
    }

    .footer-top {
        flex-direction: column;
        gap: 20px;
    }

    .footer-social {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-copy a {
        font-size: 12px;
    }
}
