*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #050816;
    color: #e8eaf0;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
}

header {
    background: #0a0f2e;
    border-bottom: 1px solid #1a2050;
    padding: 0 5%;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 60px;
    flex-wrap: wrap;
}

.nav-logo {
    flex: 0 0 auto;
}

.nav-logo img {
    height: 36px;
    display: block;
}

.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    flex: 1 1 auto;
    justify-content: center;
}

.nav-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

nav a {
    color: #c8cce0;
    text-decoration: none;
    font-size: 15px;
}

nav a:hover,
nav a[aria-current="page"] {
    color: #ffffff;
    text-decoration: underline;
}

.nav-actions .button-link {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #edf3ff 0%, #d9e7ff 100%);
    border: 1px solid #86a9ff;
    box-shadow: 0 8px 18px rgba(55, 103, 214, 0.22);
    color: #1840a4;
    font-weight: 700;
}

.nav-actions .button-link:hover {
    text-decoration: none;
    background: linear-gradient(180deg, #f8fbff 0%, #e7efff 100%);
    border-color: #a7c0ff;
    color: #12388f;
}

.nav-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-logout-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: #c8cce0;
    font-size: 15px;
}

.nav-logout-btn:hover {
    color: #ffffff;
    text-decoration: underline;
}

main {
    width: min(1120px, 90%);
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.hero {
    padding: 1rem 0 1.25rem;
    border-bottom: 1px solid #1a2050;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

.hero p {
    font-size: 1.1rem;
    color: #a8b0cc;
    margin: 0;
}

section {
    margin-bottom: 1.5rem;
}

.content-block {
    background: linear-gradient(180deg, #0b1133 0%, #080d24 100%);
    border: 1px solid #1a2050;
    border-radius: 16px;
    padding: 1.25rem;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem;
}

p {
    margin: 0 0 0.75rem;
    color: #c8cce0;
}

ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #c8cce0;
}

li {
    margin-bottom: 0.4rem;
}

footer {
    border-top: 1px solid #1a2050;
    min-height: 48px;
}

/* ---- Shared form styles (contact + signup) ---- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    color: #ffffff;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid #1f275e;
    border-radius: 10px;
    background: #060a1e;
    color: #e8eaf0;
    font: inherit;
}

select option {
    background: #060a1e;
    color: #e8eaf0;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #4f77ff;
    outline-offset: 1px;
    border-color: #4f77ff;
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3.1rem;
}

.password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #a8b0cc;
    box-shadow: none;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus {
    color: #ffffff;
    background: #0b1133;
}

.password-toggle:focus {
    outline: 2px solid #4f77ff;
    outline-offset: 1px;
}

.password-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

.password-strength {
    min-height: 2.1rem;
}

.password-strength-bar {
    width: 100%;
    height: 0.4rem;
    overflow: hidden;
    border-radius: 8px;
    background: #11183f;
}

.password-strength-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: transparent;
    transition: width .15s, background .15s;
}

.password-strength-text {
    min-height: 1rem;
    margin: 0.3rem 0 0;
    font-size: 13px;
    font-weight: 700;
    color: #a8b0cc;
}

.password-strength[data-strength="weak"] .password-strength-bar span {
    width: 25%;
    background: #d94d56;
}

.password-strength[data-strength="fair"] .password-strength-bar span {
    width: 50%;
    background: #ffbd7a;
}

.password-strength[data-strength="good"] .password-strength-bar span {
    width: 75%;
    background: #4f77ff;
}

.password-strength[data-strength="strong"] .password-strength-bar span {
    width: 100%;
    background: #7bd88f;
}

.password-strength[data-strength="weak"] .password-strength-text {
    color: #ffb3b3;
}

.password-strength[data-strength="fair"] .password-strength-text {
    color: #ffbd7a;
}

.password-strength[data-strength="good"] .password-strength-text {
    color: #b8c7ff;
}

.password-strength[data-strength="strong"] .password-strength-text {
    color: #a0d6a7;
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    background: #ffffff;
    color: #050816;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.status {
    margin-top: 1rem;
    color: #c8cce0;
}

.status.error {
    color: #ffb3b3;
}

.success {
    display: none;
    color: #d6f5d3;
}

.status,
.login-error,
.login-success,
.modal-error,
.upload-drag-error,
.upload-feedback {
    position: relative;
}

.message-dismissible {
    padding-right: 2.25rem;
}

.message-dismiss {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: currentColor;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    opacity: .72;
    box-shadow: none;
}

.message-dismiss:hover,
.message-dismiss:focus {
    background: rgba(255, 255, 255, .12);
    opacity: 1;
}

.message-dismiss:focus {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

@keyframes message-appear {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes message-highlight {
    0% {
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
    35% {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
}

.status,
.login-error,
.login-success,
.modal-error,
.upload-drag-error,
.upload-feedback,
.message-appearing {
    animation: message-appear .32s ease-out both;
}

.upload-feedback.message-appearing,
.upload-feedback {
    animation: message-appear .32s ease-out both, message-highlight 1.1s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .status,
    .login-error,
    .login-success,
    .modal-error,
    .upload-drag-error,
    .upload-feedback,
    .message-appearing {
        animation: none;
    }
}

/* ---- Login page ---- */
.login-card {
    background: linear-gradient(180deg, #0b1133 0%, #080d24 100%);
    border: 1px solid #1a2050;
    border-radius: 16px;
    padding: 2rem;
    width: min(420px, 100%);
    margin: 0 auto 3rem;
}

.login-card h2 {
    margin: 0 0 1.5rem;
}

.login-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.login-fields label {
    display: block;
    color: #c8cce0;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 0.35rem;
}

.login-fields input {
    padding: 0.8rem 0.9rem;
    border: 1px solid #1f275e;
    border-radius: 10px;
    background: #060a1e;
    color: #e8eaf0;
    font: inherit;
    font-size: 15px;
}

.login-fields input:focus {
    outline: 2px solid #4f77ff;
    outline-offset: 1px;
    border-color: #4f77ff;
}

.login-error {
    margin: 0.75rem 0 0;
    font-size: 14px;
    color: #ffb3b3;
    font-weight: 600;
}

.login-success {
    margin: 0.75rem 0 0;
    font-size: 14px;
    color: #a3d9a5;
    font-weight: 600;
}

.login-submit {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    background: #ffffff;
    color: #050816;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
}

.login-submit:hover {
    background: #e8eaf0;
}

/* ---- Dashboard: upload panel & modal ---- */
.upload-panel {
    margin-top: clamp(20px, 2.6vh, 32px);
    padding: clamp(20px, 2.4vw, 30px);
    background: rgba(11, 17, 51, .5);
    border: 1.5px dashed #1a2050;
    border-radius: 20px;
    text-align: center;
    transition: background .15s, border-color .15s;
}

.upload-panel.drop-hover {
    background: rgba(255, 138, 24, .07);
    border-color: #ff8a18;
}

.upload-desc {
    margin: 0 0 18px;
    font-size: clamp(14px, 1.1vw, 16px);
    font-weight: 500;
    color: #a8b0cc;
    line-height: 1.5;
    max-width: 46ch;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 18px;
}

.upload-drop-text {
    margin: 0 0 6px;
    font-size: clamp(15px, 1.2vw, 17px);
    font-weight: 700;
    color: #e8eaf0;
}

.upload-size-hint {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #5a6a88;
}

.upload-or {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #5a6a88;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.btn-upload {
    min-width: 120px;
    height: 44px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    padding: 0 22px;
    border: none;
    cursor: pointer;
    background: linear-gradient(180deg, #ff8a18, #ff6d12);
    color: #ffffff;
}

.btn-upload:hover {
    opacity: 0.88;
}

.btn-primary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    cursor: pointer;
    transition: opacity .15s;
}

.btn-primary {
    background: linear-gradient(180deg, #ff8a18, #ff6d12);
    box-shadow: 0 8px 18px rgba(255, 127, 28, .22);
}

.btn-danger {
    background: linear-gradient(180deg, #d94d56, #b8323d);
    box-shadow: 0 8px 18px rgba(217, 77, 86, .18);
}

.btn-primary:hover,
.btn-danger:hover {
    opacity: 0.88;
}

.btn-primary:disabled,
.btn-danger:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    box-shadow: none;
}

.upload-drag-error {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #ffb3b3;
}

.upload-feedback {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.upload-success {
    background: rgba(40, 167, 69, .1);
    border: 1px solid rgba(40, 167, 69, .25);
    color: #a0d6a7;
}

.upload-error {
    background: rgba(192, 57, 43, .1);
    border: 1px solid rgba(192, 57, 43, .25);
    color: #ffb3b3;
}

.dashboard-table-section {
    margin-top: clamp(24px, 3vh, 36px);
}

.dashboard-table-title {
    margin: 0 0 14px;
    font-size: clamp(20px, 1.8vw, 24px);
    font-weight: 800;
    letter-spacing: -.03em;
    color: #e8eaf0;
}

.dashboard-table-empty {
    margin: 0;
    color: #a8b0cc;
    font-size: 15px;
    line-height: 1.5;
}

.dashboard-table-wrap {
    overflow-x: auto;
    border: 1px solid #1a2050;
    border-radius: 18px;
    background: rgba(11, 17, 51, .42);
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(26, 32, 80, .9);
}

.dashboard-table th {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #a8b0cc;
}

.dashboard-table td {
    font-size: 14px;
    color: #e8eaf0;
}

.inline-delete-form {
    margin: 0;
}

.inline-delete-link {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffb3b3;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.inline-delete-link:hover,
.inline-delete-link:focus {
    color: #ffd0d0;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

.users-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dashboard-table tbody tr {
    transition: background .15s;
}

.dashboard-table tbody tr.selected {
    background: rgba(255, 138, 24, .12);
}

#usersTable tbody tr {
    cursor: pointer;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(40, 167, 69, .14);
    border: 1px solid rgba(40, 167, 69, .28);
    color: #a0d6a7;
}

.status-badge.pending {
    background: rgba(255, 138, 24, .12);
    border: 1px solid rgba(255, 138, 24, .26);
    color: #ffbd7a;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-dialog {
    width: min(440px, 100%);
    background: #0a1035;
    border: 1px solid #1a2050;
    border-radius: 24px;
    padding: clamp(24px, 3vw, 36px);
    box-shadow: 0 24px 56px rgba(0, 0, 0, .5);
}

.modal-title {
    margin: 0 0 20px;
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 800;
    letter-spacing: -.04em;
    color: #e8eaf0;
}

.modal-choose-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px dashed #1a2050;
    border-radius: 14px;
    background: rgba(11, 17, 51, .5);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 14px;
    font-weight: 600;
    color: #a8b0cc;
    word-break: break-all;
}

.modal-choose-label:hover {
    border-color: #ff8a18;
    background: rgba(255, 138, 24, .06);
}

.modal-choose-label svg {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    color: #ff8a18;
}

.modal-size-note {
    margin: 8px 0 0;
    font-size: 12px;
    font-weight: 500;
    color: #5a6a88;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.modal-field label {
    font-size: 14px;
    font-weight: 600;
    color: #c8cce0;
}

.modal-field input {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #1f275e;
    background: #060a1e;
    color: #e8eaf0;
    font: inherit;
    font-size: 15px;
}

.modal-field input:focus {
    outline: 2px solid #4f77ff;
    outline-offset: 1px;
    border-color: #4f77ff;
}

.modal-confirm-text {
    margin: 0 0 24px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    color: #c8cce0;
}

.modal-error {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #ffb3b3;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.modal-btn-cancel {
    padding: 0 20px;
    height: 42px;
    border-radius: 12px;
    border: 1.5px solid #1a2050;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #a8b0cc;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.modal-btn-cancel:hover {
    border-color: #2a3470;
    color: #e8eaf0;
}

.modal-btn-upload {
    padding: 0 22px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(180deg, #ff8a18, #ff6d12);
    box-shadow: 0 8px 18px rgba(255, 127, 28, .22);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    cursor: pointer;
    transition: opacity .15s;
}

.modal-btn-upload:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- Media queries ---- */
@media (max-width: 640px) {
    header {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    nav {
        height: auto;
        gap: 0.85rem 1.25rem;
    }

    .nav-logo {
        width: 100%;
    }

    .nav-links,
    .nav-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.85rem 1.25rem;
    }

    .nav-links {
        justify-content: flex-start;
    }

    .nav-actions {
        margin-left: 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .content-block {
        padding: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.25rem;
    }
}
