:root {
    --orange: #ff7d05;
    --orange-dark: #d85e00;
    --orange-soft: #fff2e7;
    --ink: #252a31;
    --muted: #68717d;
    --line: #e4e7eb;
    --surface: #ffffff;
    --background: #f5f6f8;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --warning: #9a6700;
    --warning-bg: #fff8e6;
    --shadow: 0 18px 45px rgba(25, 31, 40, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 125, 5, 0.08), transparent 27rem),
        var(--background);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.header-inner {
    width: min(1100px, calc(100% - 40px));
    min-height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 205px;
    max-width: 52vw;
    height: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.access-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.logout-link {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid var(--orange);
    padding: 5px 0 3px;
}

.logout-link:hover {
    color: var(--orange-dark);
}

.page-content {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    flex: 1;
}

.login-page .page-content {
    display: grid;
    place-items: center;
    padding: 64px 0;
}

.login-card {
    width: min(100%, 460px);
    padding: 42px;
    background: var(--surface);
    border: 1px solid rgba(228, 231, 235, 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.login-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 16px;
    background: var(--orange-soft);
    color: var(--orange-dark);
}

.login-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--orange-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.login-intro {
    margin: 16px 0 28px;
    color: var(--muted);
    line-height: 1.6;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 750;
}

.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    height: 52px;
    padding: 0 54px 0 15px;
    border: 1px solid #cfd4da;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.password-field input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 125, 5, 0.15);
}

.toggle-password {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: var(--orange-dark);
    background: var(--orange-soft);
    outline: none;
}

.toggle-password svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.primary-button {
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--orange);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 125, 5, 0.22);
    transition: background 0.18s ease, transform 0.18s ease;
}

.primary-button:hover {
    background: var(--orange-dark);
    transform: translateY(-1px);
}

.primary-button:focus-visible,
.icon-button:focus-visible,
.overlay-close:focus-visible {
    outline: 3px solid rgba(255, 125, 5, 0.35);
    outline-offset: 3px;
}

.message {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.message.error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #fecdca;
}

.message.warning {
    color: var(--warning);
    background: var(--warning-bg);
    border: 1px solid #fedf89;
}

.library-page .page-content {
    padding: 54px 0 72px;
}

.library-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.library-heading h1 {
    font-size: clamp(2rem, 5vw, 3.3rem);
}

.library-heading p:last-child {
    margin: 12px 0 0;
    color: var(--muted);
}

.video-list {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(25, 31, 40, 0.06);
}

.video-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 88px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.video-row:last-child {
    border-bottom: 0;
}

.video-row:hover {
    background: #fcfcfd;
}

.video-symbol {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--orange-soft);
    color: var(--orange-dark);
}

.video-symbol svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.video-details {
    min-width: 0;
}

.video-details h2 {
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.35;
}

.video-details p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.video-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.icon-button {
    width: 43px;
    height: 43px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.icon-button svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.icon-button:hover {
    border-color: var(--orange);
    background: var(--orange-soft);
    color: var(--orange-dark);
    transform: translateY(-1px);
}

.play-button {
    border-color: var(--orange);
    background: var(--orange);
    color: #fff;
}

.play-button:hover {
    background: var(--orange-dark);
    color: #fff;
}

.empty-state {
    padding: 70px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed #cfd4da;
    border-radius: 16px;
}

.empty-state svg {
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    fill: var(--orange);
}

.empty-state h2 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.site-footer {
    width: min(1100px, calc(100% - 40px));
    min-height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
    font-size: 0.86rem;
    border-top: 1px solid var(--line);
}

.site-footer a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.site-footer a:hover {
    color: var(--orange-dark);
}

.video-overlay[hidden] {
    display: none;
}

.video-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 18, 0.84);
    backdrop-filter: blur(7px);
}

.overlay-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    background: #11151b;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.overlay-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 12px 10px 20px;
    color: #fff;
    background: #1a2028;
}

.overlay-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.overlay-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.overlay-close:hover {
    background: var(--orange);
}

.overlay-close svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.video-wrapper {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 130px);
    background: #000;
}

.video-wrapper video {
    display: block;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 130px);
    object-fit: contain;
    background: #000;
}

body.overlay-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .header-inner,
    .page-content,
    .site-footer {
        width: min(100% - 26px, 1100px);
    }

    .header-inner {
        min-height: 72px;
    }

    .brand img {
        width: 170px;
    }

    .access-label {
        display: none;
    }

    .login-page .page-content {
        padding: 36px 0;
    }

    .login-card {
        padding: 30px 23px;
        border-radius: 17px;
    }

    .library-page .page-content {
        padding: 38px 0 52px;
    }

    .video-row {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 14px;
    }

    .video-symbol {
        width: 40px;
        height: 40px;
    }

    .icon-button {
        width: 40px;
        height: 40px;
    }

    .site-footer {
        min-height: 88px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 7px;
    }

    .video-overlay {
        padding: 10px;
    }

    .overlay-dialog {
        max-height: calc(100vh - 20px);
    }

    .video-wrapper,
    .video-wrapper video {
        max-height: calc(100vh - 90px);
    }
}

@media (max-width: 480px) {
    .video-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .video-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
