/* ==========================================================================
   Somali Engineering Corporation (SEC) - SEIMS
   Core Stylesheet & Design System (Pure Vanilla CSS)
   ========================================================================== */

:root {
    --navy: #082b61;
    --navy-dark: #051d42;
    --navy-2: #0e417f;
    --blue: #1976bd;
    --blue-light: #2585c7;
    --red: #9e3f43;
    --red-light: #d94c55;
    --green: #1fa463;
    --green-light: #20a565;
    --amber: #e5a522;
    --purple: #8c61c8;
    --ink: #122033;
    --muted: #65748a;
    --line: #dbe4ef;
    --soft: #f4f7fb;
    --white: #ffffff;
    --card-shadow: 0 16px 45px rgba(22, 55, 94, 0.08);
    --border-radius: 14px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: #eef3f9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: radial-gradient(circle at top right, #dceafb 0, transparent 32rem), #eef3f9;
    font-size: 14px;
    line-height: 1.5;
}

button, input, select, textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Public Layout (Header, Shell, Footer)
   -------------------------------------------------------------------------- */
.public-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.public-header {
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-lockup {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand-lockup img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.brand-lockup div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-lockup strong {
    color: var(--navy);
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.brand-lockup span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #c9d6e6;
    border-radius: 10px;
    color: var(--navy);
    font-weight: 700;
    font-size: 13px;
    background: #ffffff;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(8, 43, 97, 0.05);
}

.admin-link:hover {
    background: var(--navy);
    color: #ffffff;
    border-color: var(--navy);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(8, 43, 97, 0.15);
}

.form-intro {
    max-width: 920px;
    margin: 48px auto 20px;
    padding: 0 24px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px !important;
    color: var(--blue) !important;
    font-size: 12px !important;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.form-intro h1 {
    margin: 0;
    color: var(--navy);
    font-family: 'Outfit', sans-serif;
    font-size: clamp(32px, 5vw, 46px);
    line-height: 1.12;
    letter-spacing: -0.03em;
    font-weight: 900;
}

.form-intro > p {
    max-width: 680px;
    margin: 16px auto 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   Employee Registration Form
   -------------------------------------------------------------------------- */
.employee-form {
    width: min(1060px, calc(100% - 32px));
    margin: 0 auto 54px;
}

.form-section {
    margin-top: 22px;
    padding: 32px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-fast);
}

.form-section:hover {
    box-shadow: 0 20px 50px rgba(22, 55, 94, 0.1);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid #e6edf5;
}

.section-heading > span {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(145deg, var(--navy), var(--blue));
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 4px 14px rgba(8, 43, 97, 0.2);
}

.section-heading h2 {
    margin: 2px 0 6px;
    color: var(--navy);
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.field-grid {
    display: grid;
    gap: 20px;
    margin-top: 18px;
}

.field-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.one-third {
    grid-template-columns: minmax(0, 1fr) 2fr;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field > span {
    font-size: 12px;
    color: #34445b;
    font-weight: 700;
    letter-spacing: 0.015em;
}

.field b {
    color: var(--red);
    margin-left: 3px;
}

.field input, .field select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: var(--ink);
    background: #fbfcfe;
    border: 1.5px solid #ccd8e7;
    border-radius: 10px;
    outline: none;
    transition: var(--transition-fast);
    font-size: 13.5px;
}

.field input:focus, .field select:focus {
    border-color: var(--blue);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(25, 118, 189, 0.14);
}

/* --------------------------------------------------------------------------
   HD Photograph Uploader Box
   -------------------------------------------------------------------------- */
.photo-uploader {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border: 2px dashed #b8c9dc;
    background: #f8fbff;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.photo-uploader:hover, .photo-uploader.dragover {
    border-color: var(--blue);
    background: #f0f7ff;
}

.photo-uploader input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.photo-preview {
    width: 110px;
    height: 125px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    color: #9aa9ba;
    background: #e8eff7;
    border: 2px solid #d1dce9;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-align: center;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-uploader strong {
    display: block;
    color: var(--navy);
    font-size: 16px;
    font-weight: 800;
}

.photo-uploader p {
    margin: 6px 0 14px;
    color: var(--muted);
    font-size: 12px;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--navy);
    font-size: 12px;
    font-weight: 800;
    transition: var(--transition-fast);
}

.photo-uploader:hover .upload-button {
    background: var(--blue);
}

/* --------------------------------------------------------------------------
   Declaration & Submit Action
   -------------------------------------------------------------------------- */
.declaration {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 22px 2px;
    padding: 18px 20px;
    border-radius: 14px;
    background: #eaf3fb;
    color: #3e536c;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid #d3e4f5;
}

.declaration input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
    cursor: pointer;
}

.submit-button {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(8, 43, 97, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-fast);
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(8, 43, 97, 0.28);
}

.submit-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.form-message {
    margin: 18px 0;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-message.submitting {
    background: #eaf3fb;
    color: var(--navy);
    border: 1px solid #cce1f7;
}

.form-message.success {
    background: #e8f7ed;
    color: #176335;
    border: 1px solid #c2ebcf;
}

.form-message.error {
    background: #fff0f0;
    color: #9b282d;
    border: 1px solid #ffd2d4;
}

/* --------------------------------------------------------------------------
   Submission Success Receipt Modal
   -------------------------------------------------------------------------- */
.success-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 24, 52, 0.82);
    backdrop-filter: blur(10px);
    overflow: auto;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-card {
    width: min(620px, 100%);
    padding: 38px;
    text-align: center;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
}

.success-check {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    margin: 0 auto 16px;
    border-radius: 50%;
    color: #ffffff;
    background: #20a565;
    font-size: 38px;
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(32, 165, 101, 0.32);
}

.success-kicker {
    margin: 0;
    color: #159156;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.success-card h2 {
    margin: 10px 0 8px;
    color: var(--navy);
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
}

.success-text {
    max-width: 500px;
    margin: 0 auto;
    color: #607187;
    font-size: 13.5px;
    line-height: 1.65;
}

.success-person {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 24px 0 16px;
    padding: 16px 18px;
    text-align: left;
    background: #f2f7fb;
    border: 1px solid #dce6f0;
    border-radius: 14px;
}

.success-person img {
    width: 80px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    background: #dfe8f2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.success-person div {
    min-width: 0;
}

.success-person strong, .success-person span, .success-person small {
    display: block;
}

.success-person strong {
    color: var(--navy);
    font-size: 16px;
    font-weight: 800;
}

.success-person span {
    margin-top: 4px;
    color: #3d526b;
    font-size: 13px;
    font-weight: 600;
}

.success-person small {
    margin-top: 4px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 600;
}

.success-reference {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 14px 18px;
    text-align: left;
    border: 1.5px dashed #b6c8db;
    border-radius: 12px;
    background: #fafcff;
}

.success-reference span {
    color: #738298;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.success-reference strong {
    grid-row: 1 / 3;
    grid-column: 2;
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
    font-family: monospace;
}

.success-reference small {
    margin-top: 4px;
    color: #8b98a8;
    font-size: 11px;
}

.success-actions {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.success-actions button {
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: var(--navy);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.success-actions button:hover {
    background: var(--blue);
}

.success-actions .success-close {
    color: var(--navy);
    background: #eef3f8;
    border: 1px solid #d6e0eb;
}

.success-actions .success-close:hover {
    background: #e2ecf6;
    color: var(--navy);
}

.success-note {
    display: block;
    margin-top: 14px;
    color: #8794a4;
    font-size: 10px;
}

/* --------------------------------------------------------------------------
   Public Footer
   -------------------------------------------------------------------------- */
.public-footer {
    padding: 26px max(24px, calc((100vw - 1060px) / 2));
    color: #718197;
    border-top: 1px solid var(--line);
    font-size: 12px;
    background: #ffffff;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.footer-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.footer-contact {
    display: flex;
    gap: 18px;
    align-items: center;
}

.footer-contact span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   Responsive Styles
   -------------------------------------------------------------------------- */
@media (max-width: 850px) {
    .field-grid.three, .field-grid.two, .field-grid.one-third {
        grid-template-columns: 1fr;
    }
    .public-header {
        padding: 0 16px;
    }
    .brand-lockup span {
        display: none;
    }
    .admin-link {
        font-size: 12px;
        padding: 8px 14px;
    }
    .form-section {
        padding: 22px;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .footer-contact {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .brand-lockup strong {
        font-size: 13px;
    }
    .brand-lockup img {
        width: 44px;
        height: 44px;
    }
    .form-intro {
        margin-top: 32px;
    }
    .employee-form {
        width: calc(100% - 20px);
    }
    .form-section {
        padding: 18px;
        border-radius: 14px;
    }
    .photo-uploader {
        flex-direction: column;
        text-align: center;
    }
    .success-card {
        padding: 24px 18px;
    }
    .success-actions {
        grid-template-columns: 1fr;
    }
    .success-reference {
        grid-template-columns: 1fr;
    }
    .success-reference strong {
        grid-row: auto;
        grid-column: auto;
        margin-top: 6px;
    }
}
