@import url("v2-preview.css");

/* The live portal shares the approved V2 visual language with the mockup. */
body.login-page { min-height: 100vh; }
.login-page .login-scene { min-height: 100vh; padding-top: 60px; }
.login-page .login-content { position: relative; z-index: 1; }
.login-page .login-panel { min-width: 0; }
.login-page .login-footer { position: absolute; bottom: 20px; left: 50%; z-index: 1; width: 90%; margin: 0; color: #a2bea0; font-size: 10px; letter-spacing: .14em; text-align: center; transform: translateX(-50%); }

.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 13px; color: #d4e2d1; font-size: 12px; font-weight: 650; letter-spacing: .035em; }
.login-form input { width: 100%; min-height: 50px; padding: 0 15px; border: 1px solid #a1ff9e36; border-radius: 0; outline: 0; background: #050a069e; color: #ecf7eb; font-size: 15px; transition: border-color .16s ease, box-shadow .16s ease; }
.login-form input:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px #a1ff9e26; }
.login-form .remember-me { display: flex; align-items: center; gap: 10px; margin-top: 7px; color: #d4e2d1; cursor: pointer; }
.login-form .remember-me input { width: 17px; min-height: 17px; flex: 0 0 17px; margin: 0; padding: 0; accent-color: var(--green-bright); }
.login-form .remember-me span { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.login-form button { display: flex; min-height: 51px; align-items: center; justify-content: space-between; margin-top: 20px; padding: 0 18px; border: 0; background: linear-gradient(90deg, #a5ffa1, #59ee72); color: #08150a; font-size: 14px; font-weight: 800; cursor: pointer; }
.login-form button:hover { filter: brightness(1.09); }
.login-form button span { font-size: 20px; font-weight: 400; }

button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.notice { margin: 16px 0; padding: 13px 15px; border: 1px solid transparent; font-size: 13px; line-height: 1.5; }
.notice-error { border-color: #fca5a566; background: #601d1d55; color: #ffd0d0; }
.notice-warning { border-color: #f8ca6a66; background: #62410e55; color: #ffe4a0; }
.notice-success { border-color: #a1ff9e66; background: #16412277; color: #c4ffc4; }

body.portal-page { position: relative; isolation: isolate; min-height: 100vh; padding: 70px 24px 90px; overflow-x: hidden; background: radial-gradient(ellipse at 50% -10%, #1d3621, #07100a 53%, #050805); }
.portal-page .dashboard-rune { position: absolute; top: 95px; right: -2vw; z-index: -1; color: #3b624038; font-family: "Segoe UI Historic", "Noto Sans Runic", "Arial Unicode MS", serif; font-size: min(72vw, 1000px); line-height: 1; text-shadow: 0 0 120px #86ff7620; pointer-events: none; }
.topbar, .portal-shell { width: min(100%, 1190px); margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -.035em; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--green); color: var(--green); font-family: "Segoe UI Historic", "Noto Sans Runic", "Arial Unicode MS", serif; font-size: 20px; font-weight: 400; box-shadow: 0 0 20px #77ff8324; }
.topbar-actions, .topbar-nav { display: flex; align-items: center; gap: 27px; }
.topbar-nav a, .logout-button { border: 0; background: none; color: var(--muted); font-size: 13px; }
.topbar-nav a:hover, .topbar-nav a[aria-current="page"], .logout-button:hover { color: var(--green); }
.portal-shell { padding: 0; }
.hero { position: relative; display: flex; min-height: 370px; flex-direction: column; justify-content: end; padding: 90px 0 60px; }
.hero .eyebrow { margin: 0 0 20px; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .2em; }
.hero h1 { margin: 0 0 20px; font-size: clamp(54px, 6.7vw, 90px); letter-spacing: -.055em; line-height: 1.02; }
.hero > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 15px; }
.hero-seal { position: absolute; right: 0; bottom: 68px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-top: 1px solid var(--line); }
.section-heading h2, .section-heading span { margin: 0; color: #b5cbb4; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px; font-weight: 750; letter-spacing: .2em; }
.section-heading span { color: var(--green); text-align: right; }
.section-heading a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.project-card { position: relative; display: flex; min-height: 240px; flex-direction: column; overflow: hidden; padding: 25px; border: 1px solid #9ddaa53d; background: linear-gradient(145deg, #132016e8, #0a110ce8); color: var(--text); box-shadow: inset 0 1px #ffffff08, 0 20px 45px #0004; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.project-card::after, .backup-card::after { position: absolute; top: 0; right: 0; width: 30px; height: 30px; border-top: 1px solid #a1ff9e90; border-right: 1px solid #a1ff9e90; content: ""; pointer-events: none; }
a.project-card:hover { transform: translateY(-4px); border-color: #a1ff9e9c; box-shadow: 0 22px 55px #0008, 0 0 30px #6dff8014; }
.project-card-local { border-color: #a1ff9e70; background: linear-gradient(145deg, #172b1a, #0a150c); }
.project-card-disabled { opacity: .58; }
.project-rune { position: absolute; right: -5px; bottom: -48px; color: #79c78524; font-family: "Segoe UI Historic", "Noto Sans Runic", "Arial Unicode MS", serif; font-size: 190px; line-height: 1; pointer-events: none; }
.project-number { position: relative; z-index: 1; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .2em; }
.project-copy { position: relative; z-index: 1; margin-top: 45px; }
.project-copy h3 { margin: 0 0 9px; font-size: clamp(21px, 2vw, 24px); font-weight: 700; letter-spacing: -.025em; line-height: 1.12; overflow-wrap: anywhere; }
.project-copy p { max-width: 240px; margin: 0; color: #b0c0af; font-size: 13px; line-height: 1.5; }
.project-action { position: relative; z-index: 1; display: inline-block; margin-top: auto; padding-top: 14px; color: var(--green); font-size: 12px; font-weight: 750; }
.backup-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 22px 25px; border: 1px solid #a1ff9e70; background: linear-gradient(100deg, #142519, #0b150d); color: var(--green); transition: background .18s ease; }
.backup-entry:hover { background: #1a3320; }
.backup-entry strong, .backup-entry small { display: block; }
.backup-entry strong { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.backup-entry small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.hero.backup-hero { min-height: 0; padding: 40px 0 32px; }
.backup-hero h1 { font-size: clamp(30px, 4vw, 48px); }
.backup-hero .eyebrow { margin-bottom: 12px; }
.backup-hero .hero-seal { display: none; }
.backup-intro, .backup-empty { color: var(--muted); font-size: 14px; line-height: 1.55; }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.backup-card { position: relative; min-width: 0; padding: 26px; border: 1px solid #9ddaa53d; background: linear-gradient(145deg, #132016f0, #0a110cf0); box-shadow: 0 20px 45px #0004; }
.backup-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.backup-card-heading h3 { margin: 0; font-size: 27px; }
.backup-card h4 { margin: 28px 0 0; font-size: 20px; }
.backup-primary, .backup-secondary, .archive-protect { padding: 10px 13px; border: 1px solid #a1ff9e78; background: #234a2b66; color: var(--green); font-size: 12px; font-weight: 750; }
.backup-primary:hover, .backup-secondary:hover, .archive-protect:hover { background: #3669418c; }
.backup-result { margin: 18px 0 0; padding: 11px 13px; font-size: 13px; line-height: 1.45; }
.backup-result small { display: block; margin-top: 4px; opacity: .75; }
.backup-result-success { background: #16412277; color: #c4ffc4; }
.backup-result-error { background: #601d1d55; color: #ffd0d0; }
.schedule-form { margin-top: 26px; }
.schedule-toggle { display: flex; align-items: center; gap: 9px; color: #d4e2d1; font-size: 13px; font-weight: 650; }
.schedule-toggle input { accent-color: var(--green-bright); }
.schedule-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 20px 0; }
.schedule-fields label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.schedule-fields label:last-child { grid-column: 1 / -1; }
.schedule-fields input, .schedule-fields select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #a1ff9e36; border-radius: 0; background: #050a06; color: var(--text); }
.archive-list { display: grid; gap: 10px; margin: 13px 0 0; padding: 0; list-style: none; }
.archive-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.archive-name { overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.archive-meta { grid-column: 1; color: var(--muted); font-size: 11px; }
.archive-list form { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.archive-protect { padding: 7px 9px; font-size: 11px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.backup-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 14px 0 20px; }
.backup-toolbar label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.backup-search { flex: 1 1 220px; }
.backup-toolbar input, .backup-toolbar select { min-height: 40px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 0; background: #0a150d; color: var(--text); }
.backup-toolbar p { margin: 0; padding-bottom: 12px; color: var(--muted); font-size: 12px; }
.backup-table-scroll { overflow-x: auto; border: 1px solid var(--line); background: #0a110ce8; }
.backup-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.backup-table thead th { padding: 13px 16px; background: #142219; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.backup-summary-row > th, .backup-summary-row > td { padding: 13px 16px; border-top: 1px solid var(--line); }
.backup-summary-row:hover { background: #a1ff9e06; }
.backup-summary-row > th { min-width: 170px; font-size: 14px; }
.backup-summary-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.backup-status { display: inline-block; padding: 5px 8px; border: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
.backup-status-success { background: #16412277; color: #c4ffc4; }
.backup-status-error { border-color: #fca5a566; background: #601d1d55; color: #ffd0d0; }
.backup-status-waiting { color: var(--muted); }
.backup-date, .backup-schedule { color: #b5cbb4; white-space: nowrap; font-size: 12px; }
.backup-row-actions { display: flex; align-items: center; gap: 8px; }
.backup-row-actions button { padding: 8px 10px; white-space: nowrap; }
.backup-details-toggle { background: transparent; }
.backup-details-row > td { padding: 0; }
.backup-details { padding: 22px; border-top: 1px solid var(--line); background: #132016; }
.backup-details h3 { margin: 0; color: var(--green); font-size: 16px; }
.backup-detail-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; }
.backup-details h4 { margin: 20px 0 16px; font-size: 14px; }
.backup-details .schedule-form { margin-top: 0; }
.backup-details .schedule-fields { margin: 16px 0; }
.backup-table [hidden], .backup-toolbar[hidden] { display: none !important; }
@media (max-width: 850px) {
    .backup-summary-row > th, .backup-summary-row > td, .backup-table thead th { padding: 11px; }
    .backup-detail-columns { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) {
    .backup-toolbar { gap: 12px; }
    .backup-search { flex-basis: 100%; }
    .backup-toolbar > label:not(.backup-search) { flex: 1 1 140px; }
    .backup-toolbar p { width: 100%; padding: 0; }
    .backup-details { padding: 16px; }
    .backup-details .archive-list li { grid-template-columns: minmax(0, 1fr); }
    .backup-details .archive-list form { grid-column: 1; grid-row: auto; }
}

@media (max-width: 850px) {
    .project-grid, .backup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-page .login-scene { padding-top: 85px; }
}
@media (max-width: 560px) {
    .login-page .login-scene { padding-top: 30px; }
    .login-page .login-footer { bottom: 13px; }
    .login-panel { padding-bottom: 42px; }
    body.portal-page { padding: 20px 18px 70px; }
    .topbar { align-items: start; }
    .brand > span:last-child { display: none; }
    .topbar-actions, .topbar-nav { gap: 10px; }
    .topbar-nav a, .logout-button { font-size: 11px; }
    .hero { min-height: 0; padding: 95px 0 45px; }
    .hero h1 { font-size: 56px; }
    .hero-seal { position: static; margin-top: 30px; padding: 0; }
    .project-grid, .backup-grid { grid-template-columns: 1fr; }
    .project-card { min-height: 220px; }
    .backup-card-heading { flex-direction: column; }
    .section-heading { align-items: start; }
    .section-heading span { max-width: 58%; }
    .archive-list li { grid-template-columns: 1fr; }
    .archive-list form { grid-column: 1; grid-row: auto; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
