*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f4f4f4;
    --surface: #ffffff;
    --surface-2: #f0f0f0;
    --accent: #ff6b00;
    --accent-hover: #e85d04;
    --text: #111111;
    --text-muted: #555555;
    --success: #166534;
    --error: #991b1b;
    --border: #111111;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: none;
}

body.admin-shell {
    background-color: #f0f0f0;
    color: #111;
    overflow-x: hidden;
}

body.admin-shell::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: url('../fondo.png') center center / cover no-repeat;
    pointer-events: none;
}

body.admin-shell .page,
body.admin-shell .admin-page {
    position: relative;
    z-index: 1;
}

body.form-page {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: #f0f0f0;
    color: #111;
    min-height: 100vh;
    overflow-x: hidden;
}

body.form-page::before {
    display: none;
}

/* Fondo ajustado a toda la pantalla como el mockup */
body.form-page::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: url('../fondo.png') center center no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
}

body.form-page .page {
    position: relative;
    z-index: 1;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 6vh, 4.5rem) clamp(0.25rem, 1vw, 0.75rem) clamp(1rem, 2vh, 1.5rem);
    min-height: 100vh;
}

body.form-page .manga-card {
    width: min(82vw, 1080px);
    margin-top: clamp(3.5rem, 9vh, 6.5rem);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

body.form-page .manga-header {
    text-align: center;
    margin-bottom: clamp(0.85rem, 2vh, 1.35rem);
    padding: 0 1rem;
}

body.form-page .manga-title {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.25;
    color: #111;
}

body.form-page .title-line {
    display: block;
    font-size: clamp(1.5rem, 3.8vw, 2.5rem);
    letter-spacing: 0.01em;
}

body.form-page .card-body {
    padding: 0 clamp(0.5rem, 2vw, 1.5rem);
}

body.form-page .manga-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.25rem, 3vh, 2rem) clamp(2rem, 5vw, 4rem);
}

body.form-page .form-col {
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 2.5vh, 1.75rem);
}

body.form-page .bubble-field label {
    display: block;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 700;
    color: #111;
    margin-bottom: 0.55rem;
    padding-left: 0.2rem;
}

body.form-page .bubble-input-wrap {
    position: relative;
    margin-top: 6px;
}

body.form-page .bubble-input-wrap::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 18px;
    width: 14px;
    height: 14px;
    background: linear-gradient(180deg, #d8d8d8 0%, #ececec 100%);
    border-left: 2.5px solid #111;
    border-top: 2.5px solid #111;
    transform: rotate(45deg);
    z-index: 2;
}

body.form-page .bubble-input-wrap input,
body.form-page .bubble-input-wrap select {
    width: 100%;
    min-height: clamp(3rem, 5.5vh, 3.75rem);
    background: linear-gradient(180deg, #d4d4d4 0%, #f7f7f7 35%, #ffffff 100%);
    border: 2.5px solid #111;
    border-radius: 12px;
    color: #111;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(1.05rem, 1.9vw, 1.3rem);
    font-weight: 400;
    padding: 0.85rem 1.15rem;
    box-shadow: 3px 4px 8px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s;
    position: relative;
    z-index: 1;
}

body.form-page .bubble-input-wrap select {
    cursor: pointer;
    appearance: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 10 6'%3E%3Cpath fill='%23111' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #d4d4d4 0%, #f7f7f7 35%, #ffffff 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: right 1.1rem center, 0 0;
    background-size: 12px 7px, 100% 100%;
    padding-right: 2.75rem;
    font-weight: 600;
}

body.form-page .form-actions {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: clamp(2rem, 4.5vh, 3.25rem);
    min-height: clamp(80px, 10vh, 100px);
}

body.form-page .btn-burst {
    position: absolute;
    width: clamp(320px, 55vw, 520px);
    height: clamp(80px, 10vh, 100px);
    background:
        repeating-conic-gradient(from 0deg, transparent 0deg 8deg, rgba(0,0,0,0.07) 8deg 9deg),
        radial-gradient(ellipse at center, rgba(0,0,0,0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

body.form-page .btn-register {
    position: relative;
    z-index: 1;
    display: inline-block;
    width: auto;
    min-width: min(100%, 380px);
    padding: clamp(0.85rem, 2vh, 1.1rem) clamp(3rem, 6vw, 4.5rem);
    border: 2.5px solid #111;
    border-radius: 999px;
    background: linear-gradient(180deg, #6b6b6b 0%, #3a3a3a 40%, #1a1a1a 100%);
    color: #fff;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(1.2rem, 2.8vw, 1.65rem);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 6px #111,
        4px 5px 12px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

body.form-page .alert-success,
body.form-page .alert-error {
    border: 2px solid #111;
    border-radius: 10px;
    font-weight: 600;
    font-size: clamp(0.85rem, 1.3vw, 0.98rem);
    margin: 0 auto 1rem;
    padding: 0.65rem 0.9rem;
    max-width: 92%;
    line-height: 1.4;
    text-align: center;
}

body.form-page .alert-toast {
    background: #fff;
    color: #14532d;
    box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.18);
    border-left: 6px solid #16a34a;
    animation: alertSlide 0.35s ease-out;
}

body.form-page .alert-toast strong {
    color: #166534;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.form-page .btn-register:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 6px #111,
        5px 7px 16px rgba(0, 0, 0, 0.4);
    opacity: 1;
}

body.form-page .btn-register:active {
    transform: translateY(1px);
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 6px #111,
        2px 3px 6px rgba(0, 0, 0, 0.3);
}

body.form-page .bubble-field {
    margin-bottom: 0;
}

body.form-page .bubble-input-wrap input::placeholder {
    color: #777;
    text-transform: none;
}

body.form-page .input-uppercase {
    text-transform: uppercase;
}

body.form-page .input-lowercase {
    text-transform: lowercase;
}

body.form-page .bubble-input-wrap input:focus,
body.form-page .bubble-input-wrap select:focus {
    outline: none;
    box-shadow: 3px 5px 12px rgba(0, 0, 0, 0.28);
}

body.form-page .bubble-input-wrap select option {
    background: #fff;
    color: #111;
}

body.form-page .alert-success {
    color: #166534;
}

body.form-page .alert-error {
    color: #991b1b;
    background: #fff;
    border-left: 6px solid #dc2626;
    box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.15);
    text-align: left;
}

@media (max-width: 768px) {
    body.form-page::after {
        background-size: cover;
        background-position: center center;
    }

    body.form-page .manga-form .form-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    body.form-page .manga-card {
        width: min(92vw, 480px);
    }

    body.form-page .page {
        padding: 2rem 0.75rem;
    }
}

@media (min-width: 1200px) {
    body.form-page .manga-card {
        width: min(80vw, 1150px);
    }

    body.form-page .title-line {
        font-size: 2.5rem;
    }
}

@media (min-width: 1600px) {
    body.form-page .manga-card {
        width: 1180px;
    }
}


.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.card {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid #111;
    border-radius: var(--radius);
    box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.card-header {
    background: #111;
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
}

.card-header .badge {
    display: inline-block;
    background: #ff6b00;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.card-header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.card-body {
    padding: 1.75rem;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.alert-success {
    background: #f0fdf4;
    border: 2px solid #111;
    color: #166534;
}

.alert-error {
    background: #fff7ed;
    border: 2px solid #111;
    color: #9a3412;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.4rem;
}

.form-group label span {
    color: #ff6b00;
}

.form-group input,
.form-group select {
    width: 100%;
    background: #fff;
    border: 2px solid #111;
    border-radius: 10px;
    color: #111;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.2);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23111' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-group select option {
    background: #fff;
    color: #111;
}

.form-group input::placeholder {
    color: #777;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #ff8a3d 0%, #ff6b00 45%, #e85d04 100%);
    color: #fff;
    border: 2.5px solid #111;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.9rem 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
    box-shadow: 3px 4px 0 #111;
}

.btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.footer-note {
    text-align: center;
    font-size: 0.8rem;
    color: #555;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid #111;
}

/* Admin styles */
.admin-page {
    padding: 2rem 1rem;
    max-width: 1180px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem;
    background: rgba(255, 255, 255, 0.94);
    border: 3px solid #111;
    border-radius: 14px;
    box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.18);
}

.admin-header h1 {
    font-size: 1.4rem;
    color: #111;
}

.admin-header .count {
    background: #fff;
    border: 2px solid #111;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    color: #444;
}

.admin-header .count strong {
    color: #ff6b00;
}

.table-wrap {
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #111;
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.16);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: #111;
}

thead th {
    background: #111;
    color: #fff;
    font-weight: 700;
    text-align: left;
    padding: 0.85rem 1rem;
    white-space: nowrap;
    border-bottom: 2px solid #111;
}

tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: rgba(255, 107, 0, 0.08);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #555;
}

.login-card {
    max-width: 420px;
}

.btn-secondary {
    background: #fff;
    border: 2px solid #111;
    color: #111;
    text-decoration: none;
    display: inline-block;
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    margin-top: 0;
    box-shadow: 2px 2px 0 #111;
}

.btn-secondary:hover {
    border-color: #ff6b00;
    color: #ff6b00;
    opacity: 1;
    transform: none;
}

.export-btn {
    background: #111;
    border: 2px solid #111;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s, border-color 0.2s;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
}

.export-btn:hover {
    background: #ff6b00;
    border-color: #ff6b00;
}

.admin-filters {
    padding: 1rem;
    margin-bottom: 1rem;
}

.admin-links-bar {
    margin: 1rem 0;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-links-left {
    flex: 1;
    min-width: 240px;
}

.admin-links-title {
    margin: 0 0 0.5rem;
    color: #555;
    font-size: 0.9rem;
    font-weight: 700;
}

.admin-link-item {
    margin-bottom: 0.35rem;
    word-break: break-all;
    font-size: 0.9rem;
}

.admin-link-item a {
    color: #ff6b00;
}

.admin-counter-box {
    min-width: 180px;
    padding: 0.9rem 1.1rem;
    background: #111;
    color: #fff;
    border: 3px solid #111;
    border-radius: 12px;
    text-align: center;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.admin-counter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ff6b00;
    margin-bottom: 0.25rem;
}

.admin-counter-number {
    display: block;
    font-size: 2.4rem;
    line-height: 1;
    font-weight: 800;
}

.admin-counter-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #ddd;
}

.admin-table-note {
    padding: 0.85rem 1rem;
    border-top: 2px solid #111;
    font-size: 0.85rem;
    color: #444;
    background: #fafafa;
}

.admin-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.admin-filter-search {
    grid-column: span 1;
}

.admin-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 140px;
}

.admin-actions form {
    margin: 0;
}

.admin-actions .btn-secondary,
.admin-actions button.btn-secondary {
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.admin-edit-form .form-group {
    margin-bottom: 1rem;
}

@media (max-width: 980px) {
    .admin-filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .admin-filter-search {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .admin-filter-form {
        grid-template-columns: 1fr;
    }

    .admin-filter-search {
        grid-column: span 1;
    }
}

@media (max-width: 520px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .card-header h1 {
        font-size: 1.25rem;
    }
}
