@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;500;700;800;900&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    --ink: #12231a;
    --muted: #66756d;
    --line: #d9e4dd;
    --paper: #fdfcf7;
    --soft: #f4f8f5;
    --green: #11633f;
    --green-dark: #0a3d25;
    --green-glow: rgba(17, 99, 63, .12);
    --gold: #d4af37;
    --gold-dark: #bfa12a;
    --gold-light: #f1d675;
    --gold-glow: rgba(212, 175, 55, .25);
    --rose: #b42335;
    --white: #ffffff;
    --shadow: 0 24px 70px rgba(10, 61, 37, .15);
    --shadow-sm: 0 4px 16px rgba(10, 61, 37, .08);
    --shadow-lg: 0 32px 90px rgba(10, 61, 37, .18);
    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --gold-gradient: linear-gradient(135deg, var(--gold-light), var(--gold) 46%, var(--gold-dark));
    --green-gradient: linear-gradient(135deg, #0a3d25, #11633f);
    --islamic-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23d4af37' stroke-opacity='.22' stroke-width='1.2'%3E%3Cpath d='M48 6l12 30 30 12-30 12-12 30-12-30L6 48l30-12z'/%3E%3Cpath d='M48 22l9 17 17 9-17 9-9 17-9-17-17-9 17-9z'/%3E%3Ccircle cx='48' cy='48' r='21'/%3E%3C/g%3E%3C/svg%3E");
}

* {
    box-sizing: border-box;
}

*::selection {
    background: var(--gold-glow);
    color: var(--green-dark);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(244, 248, 245, .82), rgba(253, 252, 247, .96)),
        var(--islamic-pattern),
        var(--paper);
    color: var(--ink);
    font-family: "Cairo", "Outfit", Tahoma, Arial, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--paper);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

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

img,
video {
    max-width: 100%;
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-12px) rotate(1deg); }
    66% { transform: translateY(-6px) rotate(-1deg); }
}

@keyframes glow {
    0%, 100% { opacity: .6; }
    50% { opacity: 1; }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-soft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.animate-in {
    animation: fadeIn .6s ease-out both;
}

.animate-in-up {
    animation: fadeInUp .7s ease-out both;
}

.site-header,
.admin-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(16px, 4vw, 54px);
    background: rgba(253, 252, 247, .82);
    border-bottom: 1px solid rgba(212, 175, 55, .18);
    box-shadow: 0 14px 40px rgba(10, 61, 37, .08);
    backdrop-filter: blur(22px) saturate(155%);
    transition: box-shadow .3s ease;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--green-dark);
    white-space: nowrap;
    transition: opacity .2s ease;
}

.brand:hover {
    opacity: .82;
}

.brand-mark {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: var(--radius-sm);
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .34), transparent 26%), var(--green-dark);
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .36), 0 12px 28px rgba(10, 61, 37, .22);
    transition: transform .3s ease, box-shadow .3s ease;
}

.brand:hover .brand-mark {
    transform: scale(1.05);
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .5), 0 14px 32px rgba(10, 61, 37, .28);
}

.brand-mark svg {
    width: 34px;
    height: 34px;
    display: block;
}

.brand-mark path {
    fill: rgba(212, 175, 55, .18);
    stroke: var(--gold);
    stroke-width: 1.4;
}

.brand-mark text {
    fill: #f8e7b0;
    font: 800 22px "Amiri", serif;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    place-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.menu-toggle:hover {
    background: var(--soft);
    border-color: var(--gold);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--green-dark);
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
}

.nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

.nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.main-nav a,
.lang-switch {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    position: relative;
    transition: background .2s ease, color .2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    inset: auto 50% 4px;
    height: 2px;
    width: 0;
    background: var(--gold);
    border-radius: 2px;
    transition: width .3s ease, inset-inline .3s ease;
}

.main-nav a:hover::after {
    width: calc(100% - 28px);
    inset-inline: 14px auto;
}

.main-nav a:hover,
.lang-switch:hover {
    background: rgba(212, 175, 55, .13);
    color: var(--green-dark);
}

.hero {
    position: relative;
    min-height: calc(100vh - 70px);
    display: grid;
    align-items: center;
    padding: clamp(40px, 7vw, 96px) clamp(18px, 5vw, 72px);
    overflow: hidden;
    background:
        linear-gradient(112deg, rgba(10, 61, 37, .96), rgba(17, 99, 63, .82)),
        var(--islamic-pattern),
        radial-gradient(circle at 84% 24%, rgba(212, 175, 55, .28), transparent 30%),
        #0a3d25;
    background-size: cover;
    color: var(--white);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212, 175, 55, .08), transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, .04), transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: linear-gradient(to top, var(--paper), transparent);
}

.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.hero-shape {
    position: absolute;
    border: 1px solid rgba(212, 175, 55, .15);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.hero-shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -60px;
    right: -40px;
    animation-delay: 0s;
    border-width: 2px;
    opacity: .3;
}

.hero-shape:nth-child(2) {
    width: 180px;
    height: 180px;
    bottom: 10%;
    left: -30px;
    animation-delay: -2s;
    border-width: 1px;
    opacity: .2;
}

.hero-shape:nth-child(3) {
    width: 120px;
    height: 120px;
    top: 40%;
    right: 15%;
    animation-delay: -4s;
    border-width: 3px;
    opacity: .15;
    border-style: dashed;
}

.hero-shape:nth-child(4) {
    width: 60px;
    height: 60px;
    bottom: 30%;
    right: 35%;
    animation-delay: -1s;
    background: rgba(212, 175, 55, .08);
    border: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(760px, 100%);
    animation: fadeInUp .8s ease-out both;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-size: .85em;
}

.hero h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(34px, 7vw, 76px);
    line-height: 1.08;
    animation: fadeIn .8s ease-out .2s both;
}

.hero p {
    max-width: 700px;
    color: rgba(255, 255, 255, .87);
    font-size: clamp(17px, 2vw, 22px);
    animation: fadeIn .8s ease-out .35s both;
}

.hero-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hero-actions {
    animation: fadeIn .8s ease-out .5s both;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 22px;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, background .2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.button:active:not(:disabled) {
    transform: scale(.97);
}

.button.primary {
    background: var(--gold-gradient);
    color: #1d2119;
    box-shadow: 0 12px 26px rgba(191, 161, 42, .28);
}

.button.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: saturate(112%);
    box-shadow: 0 18px 34px rgba(191, 161, 42, .36);
}

.button.ghost {
    border: 1px solid rgba(255, 255, 255, .44);
    color: var(--white);
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(4px);
}

.button.ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .6);
}

.button.muted {
    background: #e6eee9;
    color: var(--green-dark);
}

.button.muted:hover:not(:disabled) {
    background: #d5e4db;
}

.button.danger {
    background: var(--rose);
    color: var(--white);
}

.button.danger:hover:not(:disabled) {
    background: #9a1e2d;
}

.button .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
    transform: scale(0);
    animation: rippleAnim .6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

.quick-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    animation: fadeIn .8s ease-out .6s both;
}

.quick-stats span {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(4px);
    font-weight: 700;
    font-size: .88em;
    transition: background .2s ease, transform .2s ease;
}

.quick-stats span:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateY(-1px);
}

.official-strip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: min(560px, 100%);
    margin-bottom: 18px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(212, 175, 55, .35);
    background: rgba(253, 252, 247, .1);
    backdrop-filter: blur(12px);
    animation: fadeIn .8s ease-out .1s both;
}

.official-strip img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    padding: 4px;
}

.ministry-mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 999px;
    border: 2px solid rgba(212, 175, 55, .65);
    background: rgba(10, 61, 37, .82);
    color: #f8e7b0;
    font: 800 18px "Outfit", sans-serif;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .08);
}

.official-strip strong,
.official-strip span {
    display: block;
}

.official-strip strong {
    color: #fff8d9;
    font-weight: 900;
}

.official-strip span {
    color: rgba(255, 255, 255, .76);
    font-weight: 700;
    font-size: .85em;
}

.hero-media {
    position: absolute;
    inset-inline-end: clamp(20px, 7vw, 90px);
    bottom: 70px;
    width: min(420px, 38vw);
    z-index: 1;
}

.hero-panel {
    padding: 32px 28px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--radius);
    background: rgba(9, 38, 26, .45);
    box-shadow: var(--shadow), inset 0 0 80px rgba(212, 175, 55, .04);
    backdrop-filter: blur(6px);
    animation: fadeIn .8s ease-out .15s both;
}

.hero-panel:hover {
    box-shadow: var(--shadow), inset 0 0 80px rgba(212, 175, 55, .08);
}

.ayah-line {
    display: block;
    color: #f8e7b0;
    font-size: clamp(26px, 4vw, 48px);
    font-weight: 900;
    text-align: center;
    text-shadow: 0 0 40px rgba(212, 175, 55, .2);
    animation: glow 3s ease-in-out infinite;
}

.sound-bars {
    height: 90px;
    margin-top: 24px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 9px;
}

.sound-bars i {
    width: 13px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(to top, #d4af37, #f2c45f);
    animation: bars 1.35s infinite ease-in-out;
}

.sound-bars i:nth-child(1) { height: 34px; }
.sound-bars i:nth-child(2) { height: 62px; animation-delay: .1s; }
.sound-bars i:nth-child(3) { height: 48px; animation-delay: .2s; }
.sound-bars i:nth-child(4) { height: 84px; animation-delay: .3s; }
.sound-bars i:nth-child(5) { height: 52px; animation-delay: .4s; }
.sound-bars i:nth-child(6) { height: 70px; animation-delay: .5s; }
.sound-bars i:nth-child(7) { height: 38px; animation-delay: .6s; }

@keyframes bars {
    0%, 100% { transform: scaleY(.72); opacity: .8; }
    50% { transform: scaleY(1); opacity: 1; }
}

.section {
    padding: clamp(48px, 7vw, 86px) clamp(18px, 5vw, 72px);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.section-heading h2,
.admin-title h1,
.auth-card h1 {
    margin: 0 0 8px;
    font-size: clamp(26px, 4vw, 44px);
    line-height: 1.16;
}

.section-heading p {
    color: var(--muted);
}

.reader-form,
.success-box,
.auth-card {
    background: var(--white);
    border: 1px solid rgba(212, 175, 55, .18);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.reader-form {
    padding: clamp(22px, 4vw, 38px);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 800;
    font-size: .9em;
    color: var(--green-dark);
}

input,
textarea,
select {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff, #fbfdfb);
    color: var(--ink);
    font: inherit;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #bccfc3;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .15), 0 4px 12px rgba(10, 61, 37, .06);
    background: #ffffff;
}

.wide {
    grid-column: 1 / -1;
}

.duration-message {
    min-height: 22px;
    color: var(--rose);
    font-weight: 700;
    font-size: .88em;
}

.recorder-field {
    display: grid;
    gap: 12px;
}

.recorder-copy span {
    display: block;
    color: var(--green-dark);
    font-weight: 900;
    font-size: 1.05em;
}

.recorder-copy p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 600;
}

.recorder-box {
    display: grid;
    gap: 16px;
    padding: clamp(16px, 2.5vw, 24px);
    border: 1px solid rgba(212, 175, 55, .22);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(244, 248, 245, .96)),
        var(--islamic-pattern);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
    transition: box-shadow .3s ease;
}

.recorder-box:focus-within {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), 0 0 0 3px rgba(212, 175, 55, .1);
}

.device-panel,
.settings-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(212, 175, 55, .22);
    border-radius: var(--radius-sm);
    background: var(--white);
}

.device-panel > strong,
.settings-panel > strong {
    color: var(--green-dark);
    font-size: 15px;
}

.device-choices,
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

.device-card {
    padding: 10px 12px;
    border: 1px solid rgba(217, 228, 221, .88);
    border-radius: var(--radius-sm);
    background: #fbfdfb;
    transition: border-color .2s ease, background .2s ease;
}

.device-card:hover {
    border-color: rgba(212, 175, 55, .3);
    background: #ffffff;
}

.setting-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid rgba(217, 228, 221, .88);
    border-radius: var(--radius-sm);
    background: #fbfdfb;
    color: var(--green-dark);
    font-weight: 800;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.setting-check:hover {
    border-color: rgba(212, 175, 55, .3);
    background: #ffffff;
}

.setting-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--green-dark);
    flex: 0 0 auto;
    cursor: pointer;
}

.wide-setting {
    grid-column: span 2;
}

.camera-viewfinder {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #07130d;
    border: 1.5px solid rgba(212, 175, 55, .35);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 20px 50px rgba(10, 61, 37, .18);
    transition: border-color .3s ease;
}

.camera-viewfinder:focus-within {
    border-color: var(--gold);
}

.camera-viewfinder::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 54px 54px;
    opacity: .38;
}

.camera-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0;
    background: #0d1712;
}

.camera-preview.is-mirrored {
    transform: scaleX(-1);
}

.processed-preview {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: none;
}

.recorder-box.has-virtual-background .processed-preview {
    display: block;
}

.recorder-box.has-virtual-background .camera-preview {
    opacity: 0;
}

.corner {
    position: absolute;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-color: var(--gold);
    opacity: .92;
}

.corner-tl {
    top: 14px;
    left: 14px;
    border-top: 3px solid;
    border-left: 3px solid;
}

.corner-tr {
    top: 14px;
    right: 14px;
    border-top: 3px solid;
    border-right: 3px solid;
}

.corner-bl {
    bottom: 14px;
    left: 14px;
    border-bottom: 3px solid;
    border-left: 3px solid;
}

.corner-br {
    right: 14px;
    bottom: 14px;
    border-right: 3px solid;
    border-bottom: 3px solid;
}

.recording-pill {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    z-index: 3;
    display: none;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(11, 22, 16, .78);
    color: #fff;
    font: 800 12px "Outfit", "Cairo", sans-serif;
    backdrop-filter: blur(4px);
}

.recording-pill i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #e53935;
    box-shadow: 0 0 0 0 rgba(229, 57, 53, .62);
    animation: recPulse 1.2s infinite;
}

.recorder-box.is-recording .recording-pill {
    display: inline-flex;
}

@keyframes recPulse {
    0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, .68); }
    70% { box-shadow: 0 0 0 10px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}


.recorder-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.recording-timer {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    background: var(--green-dark);
    color: var(--white);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: 1px;
}

.recorder-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.fallback-upload {
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.submit-button {
    margin-top: 22px;
    min-height: 52px;
    font-size: 17px;
}

.reader-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.reader-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease, border-color .35s ease;
}

.reader-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--gold), var(--green), var(--green-dark));
    z-index: 1;
}

.reader-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .06);
    pointer-events: none;
}

.reader-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(200, 148, 50, .42);
    box-shadow: 0 30px 70px rgba(16, 42, 31, .18);
}

.reader-card > img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    padding: 16px;
    background:
        radial-gradient(circle at 20% 10%, rgba(200, 148, 50, .14), transparent 34%),
        linear-gradient(145deg, #f7fbf8, #e8f2ec);
    transition: transform .4s ease, padding .3s ease;
}

.reader-card:hover > img {
    padding: 10px;
    transform: scale(1.02);
}

.reader-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px;
    gap: 6px;
}

.reader-card h3,
.review-card h2 {
    margin: 0;
    color: var(--green-dark);
    font-size: 1.15em;
}

.reader-card p,
.review-card p,
.bio {
    color: var(--muted);
    margin: 2px 0;
    line-height: 1.5;
}

.reader-card .bio {
    font-size: .9em;
    padding: 8px 10px;
    background: var(--soft);
    border-radius: var(--radius-sm);
    margin: 6px 0;
}

dl {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: var(--soft);
    border-radius: var(--radius-sm);
}

dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

dd {
    margin: 0;
    font-weight: 900;
    color: var(--green-dark);
}

.reader-card video,
.review-card video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    margin-top: auto;
    border-radius: var(--radius-sm);
    background: #0d1712;
    border: 1px solid rgba(14, 79, 52, .12);
}

.empty-state,
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: #fff4d8;
    color: #6d4b08;
    border: 1px solid #f1d28a;
    font-weight: 600;
}

.success {
    min-height: 70vh;
    display: grid;
    place-items: center;
}

.success-box {
    width: min(620px, 100%);
    padding: 40px 32px;
    text-align: center;
    animation: fadeIn .5s ease-out;
}

.success-box h1 {
    font-size: clamp(28px, 4vw, 38px);
    color: var(--green-dark);
}

.error-box {
    border-color: #f1c6cc;
    background: #fff8f8;
}

.error-box h1 {
    color: var(--rose);
}

.admin-body {
    background: #f0f5f1;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 32px 28px;
    display: grid;
    gap: 18px;
    animation: fadeIn .5s ease-out;
}

.auth-brand {
    margin-bottom: 8px;
}

.inline {
    justify-self: center;
}

.admin-shell {
    padding: clamp(24px, 5vw, 54px);
}

.admin-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
}

.status-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.status-tabs a {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1.5px solid var(--line);
    color: var(--green-dark);
    font-weight: 900;
    font-size: .92em;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.status-tabs a:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.status-tabs a.active {
    background: var(--green-gradient);
    border-color: var(--green-dark);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(10, 61, 37, .22);
}

.status-tabs span {
    min-width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(200, 148, 50, .18);
    font-size: .82em;
}

.status-tabs a.active span {
    background: rgba(255, 255, 255, .2);
    color: var(--white);
}

.review-list {
    display: grid;
    gap: 20px;
}

.review-card {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 18px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease, border-color .3s ease;
}

.review-card:hover {
    transform: translateY(-3px);
    border-color: rgba(21, 115, 71, .22);
    box-shadow: 0 22px 52px rgba(16, 42, 31, .1);
}

.review-main {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 16px;
}

.review-main img {
    width: 118px;
    height: 118px;
    object-fit: contain;
    padding: 6px;
    background:
        radial-gradient(circle at 20% 10%, rgba(200, 148, 50, .14), transparent 34%),
        linear-gradient(145deg, #f7fbf8, #e8f2ec);
    border-radius: var(--radius-sm);
}

.review-actions {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
}

.review-actions textarea {
    min-height: 60px;
}

.site-footer {
    padding: 28px clamp(18px, 5vw, 72px);
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-weight: 600;
    text-align: center;
}

.admin-form,
.admin-table,
.manage-reader-card {
    background: var(--white);
    border: 1px solid rgba(212, 175, 55, .18);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: clamp(18px, 3vw, 28px);
}

.admin-form {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.admin-form h1,
.admin-form h2 {
    margin: 0;
    color: var(--green-dark);
}

.admin-table {
    display: grid;
    gap: 12px;
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

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

.admin-row input {
    padding: 10px 12px;
}

.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

.manage-reader-card {
    display: grid;
    gap: 14px;
    transition: transform .3s ease, box-shadow .3s ease;
}

.manage-reader-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.manage-reader-card > img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--soft);
}

.manage-reader-card h2 {
    margin: 0;
    color: var(--green-dark);
    font-size: 1.1em;
}

.manage-reader-card p {
    margin: 3px 0;
    color: var(--muted);
    font-size: .92em;
}

.manage-reader-card video,
.edit-preview video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #0d1712;
}

.edit-preview {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}

.edit-preview img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--soft);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.status-badge.pending {
    background: #fff4d8;
    color: #8d6e00;
}

.status-badge.approved {
    background: #d8f0e4;
    color: #0a6b3f;
}

.status-badge.revision {
    background: #e8e0f0;
    color: #6a3f8d;
}

.status-badge.rejected {
    background: #f8e0e0;
    color: #a02a2a;
}

@media (max-width: 860px) {
    .site-header,
    .admin-header {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .menu-toggle {
        display: grid;
    }

    .main-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 10px;
        justify-content: stretch;
    }

    .site-header.nav-open .main-nav,
    .admin-header.nav-open .main-nav {
        display: grid;
    }

    .main-nav a,
    .lang-switch {
        width: 100%;
        padding: 12px 16px;
        background: var(--white);
        border: 1px solid var(--line);
    }

    .main-nav a::after {
        display: none;
    }

    .hero {
        min-height: auto;
        padding-top: 58px;
    }

    .hero-media {
        display: none;
    }

    .hero-shapes {
        display: none;
    }

    .field-grid,
    .review-card,
    .device-choices,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .wide-setting {
        grid-column: auto;
    }

    .admin-row,
    .edit-preview {
        grid-template-columns: 1fr;
    }

    .reader-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 520px) {
    .hero-actions .button,
    .action-row .button,
    .recorder-actions .button {
        width: 100%;
    }

    .quick-stats span {
        width: 100%;
    }

    .review-main {
        grid-template-columns: 1fr;
    }

    .review-main img {
        width: 100%;
        height: 240px;
        object-fit: contain;
    }

    .reader-card > img {
        height: 240px;
    }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reader-card:hover,
    .review-card:hover,
    .manage-reader-card:hover {
        transform: none;
    }
}
