/* =========================================
   AgentCamp.Asistencia – Global Styles
   ========================================= */

:root {
    --background: #050507;
    --background-secondary: #09090d;
    --surface: #121217;
    --surface-elevated: #19191f;
    --surface-soft: rgba(255, 255, 255, 0.035);

    --accent: #e4003b;
    --accent-hover: #ff174f;
    --accent-dark: #710020;

    --border: rgba(228, 0, 59, 0.28);
    --border-strong: rgba(228, 0, 59, 0.62);
    --border-neutral: rgba(255, 255, 255, 0.10);

    --text: #f7f7f9;
    --text-secondary: #b3b3bd;
    --text-muted: #858590;

    --success: #3ed47b;
    --success-background: rgba(62, 212, 123, 0.12);

    --danger: #ff4265;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(ellipse at 80% 10%, rgba(113, 0, 32, 0.35), transparent 50%),
        radial-gradient(ellipse at 20% 90%, rgba(113, 0, 32, 0.18), transparent 40%),
        var(--background);
}

a { color: #ff8aa7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================
   Utilities
   ========================================= */
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.mt-3 { margin-top: 1rem; }

/* =========================================
   Forms
   ========================================= */
.stack-form {
    display: grid;
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 6px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(5, 5, 7, 0.85);
    border: 1px solid var(--border-neutral);
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 180ms, box-shadow 180ms;
}

.form-control--lg {
    min-height: 56px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

.form-control--readonly,
.form-control:disabled,
input:disabled {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-neutral) !important;
    cursor: not-allowed;
}

.form-control:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(228, 0, 59, 0.18);
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-check {
    display: flex;
    align-items: start;
    gap: 0.6rem;
}

.form-check input { margin-top: 0.25rem; }
.form-check label { font-size: 0.9rem; color: var(--text-secondary); }

/* =========================================
   Buttons
   ========================================= */
.btn-primary,
.btn-secondary,
.btn-back {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 180ms, transform 180ms, opacity 180ms;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--accent), #b70031);
    border-color: rgba(255, 23, 79, 0.45);
    width: 100%;
}

.btn-primary--lg {
    min-height: 56px;
    font-size: 1.05rem;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--accent-hover), var(--accent));
    transform: translateY(-1px);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-neutral);
    text-decoration: none;
    width: 100%;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
}

.btn-back {
    color: var(--text);
    background: transparent;
    border-color: var(--border-neutral);
    max-width: 240px;
    margin: 32px auto 0;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.06);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   Status Messages
   ========================================= */
.status-message {
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.92rem;
    transition: opacity 180ms;
}

.status-success {
    background: var(--success-background);
    border-color: rgba(62, 212, 123, 0.35);
    color: #a8ffc8;
}

.status-warning {
    background: rgba(255, 173, 51, 0.1);
    border-color: rgba(255, 173, 51, 0.35);
    color: #ffcc7d;
}

.status-error {
    background: rgba(255, 66, 101, 0.12);
    border-color: rgba(255, 66, 101, 0.4);
    color: #ffb0c0;
}

.status-pill {
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-pill.success {
    background: var(--success-background);
    color: #92ffc0;
}

.status-pill.warning {
    background: rgba(255, 173, 51, 0.18);
    color: #ffcc7d;
}

/* =========================================
   Loading Indicator
   ========================================= */
.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.loading-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* =========================================
   Validation Messages
   ========================================= */
.validation-message {
    color: #ff9db2;
    font-size: 0.82rem;
}

/* =========================================
   HOME PAGE – Hero Two-Column Layout
   ========================================= */
.home-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 48px 32px;
}

.home-hero__inner {
    width: 100%;
    max-width: 1180px;
    display: grid;
    grid-template-columns: 56fr 44fr;
    gap: 48px;
    align-items: center;
    min-height: 620px;
}

/* Identity Column */
.home-identity {
    position: relative;
}

.home-identity::before {
    content: "";
    position: absolute;
    inset: -48px;
    background: url('/images/circuit-pattern.svg') center/cover no-repeat;
    opacity: 0.08;
    pointer-events: none;
    border-radius: var(--radius-lg);
}

.home-identity__logo {
    width: 220px;
    height: auto;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
}

.home-identity__overline {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 12px;
    font-weight: 600;
}

.home-identity__title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 12px;
    color: var(--text);
}

.home-identity__subtitle {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 32px;
}

.home-identity__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.home-identity__org {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.home-identity__org-logo {
    width: 80px;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Validation Card */
.home-card {
    background: linear-gradient(175deg, var(--surface-elevated), var(--surface));
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 4px 32px rgba(228, 0, 59, 0.06);
}

.home-card__icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.home-card__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.home-card__desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 24px;
}

.home-card__back {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    transition: color 180ms;
}

.home-card__back:hover {
    color: var(--accent-hover);
}

/* =========================================
   TICKET PAGE
   ========================================= */
.ticket-page {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 32px 64px;
}

.ticket-page__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-neutral);
}

.ticket-page__logo {
    width: 100px;
    height: auto;
    border-radius: var(--radius-sm);
}

.ticket-page__logo--small {
    width: 72px;
    margin-left: auto;
}

.ticket-page__event-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ticket-page__body {
    max-width: 720px;
    margin: 0 auto;
}

.ticket-page__empty {
    text-align: center;
    padding: 48px 24px;
}

/* =========================================
   TICKET CARD (Credential)
   ========================================= */
.ticket {
    position: relative;
    background: linear-gradient(170deg, var(--surface-elevated), #0d0d12 60%, rgba(113, 0, 32, 0.12));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    overflow: hidden;
}

/* Side perforations */
.ticket::before,
.ticket::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--background);
    border: 1px solid var(--border);
    top: calc(50% - 10px);
}

.ticket::before { left: -11px; }
.ticket::after { right: -11px; }

.ticket__top {
    text-align: center;
    margin-bottom: 8px;
}

.ticket__logo {
    width: 100px;
    height: auto;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
}

.ticket__badge {
    display: inline-block;
    background: var(--success-background);
    border: 1px solid rgba(62, 212, 123, 0.45);
    color: #8affbb;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    box-shadow: 0 0 12px rgba(62, 212, 123, 0.2);
}

.ticket__title {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #c8ffde;
}

.ticket__present {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0;
}

.ticket__divider {
    border: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    margin: 24px 0;
}

/* Attendee */
.ticket__attendee {
    margin-bottom: 8px;
}

.ticket__name {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text);
}

.ticket__attendee-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Fields */
.ticket__field {
    display: grid;
    gap: 4px;
}

.ticket__field--wide {
    grid-column: 1 / -1;
}

.ticket__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.ticket__value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Event grid */
.ticket__event-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Footer */
.ticket__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ticket__footer-org {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket__footer-logo {
    width: 56px;
    height: auto;
    border-radius: var(--radius-sm);
}

/* =========================================
   ORGANIZER PAGES (keep existing)
   ========================================= */
.page-container {
    position: relative;
    z-index: 1;
    width: min(1180px, 100% - 2rem);
    margin: 0 auto;
    padding: 32px 0 48px;
}

.main-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

.panel-card {
    background: linear-gradient(180deg, var(--surface-elevated), var(--surface));
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-lg);
    padding: 24px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }

.overline {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.muted-text { color: var(--text-muted); }

.event-header { margin-bottom: 24px; }

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-text { flex: 1; }
.brand-logo { width: 88px; height: auto; border-radius: var(--radius-sm); }
.brand-logo-small { width: 68px; }

.event-meta {
    margin-top: 12px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.organizer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.organizer-header .btn-secondary { width: auto; }

.attendee-result p { margin-bottom: 0.55rem; }

.recent-table-wrapper { overflow-x: auto; }

.recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.recent-table th,
.recent-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-neutral);
    text-align: left;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (min-width: 900px) {
    .main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 899px) {
    .home-hero {
        padding: 32px 24px;
        align-items: flex-start;
    }

    .home-hero__inner {
        grid-template-columns: 1fr;
        gap: 32px;
        min-height: auto;
    }

    .home-identity__title {
        font-size: 2rem;
    }

    .home-identity__logo {
        width: 170px;
    }

    .home-identity__subtitle {
        font-size: 1.1rem;
        margin-bottom: 24px;
    }
}

@media (max-width: 599px) {
    .home-hero {
        padding: 24px 16px;
    }

    .home-identity__title {
        font-size: 1.65rem;
    }

    .home-identity__logo {
        width: 150px;
        margin-bottom: 16px;
    }

    .home-identity__meta {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 24px;
    }

    .home-card {
        padding: 20px;
        border-radius: 18px;
    }

    .ticket-page {
        padding: 16px 16px 48px;
    }

    .ticket-page__header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .ticket-page__logo {
        width: 72px;
    }

    .ticket {
        padding: 20px;
        border-radius: 18px;
    }

    .ticket__title {
        font-size: 1.4rem;
    }

    .ticket__name {
        font-size: 1.3rem;
    }

    .ticket__attendee-details,
    .ticket__event-grid {
        grid-template-columns: 1fr;
    }

    .page-container {
        width: calc(100% - 32px);
        padding: 24px 0 32px;
    }

    .panel-card {
        padding: 20px;
        border-radius: 18px;
    }
}

@media (max-width: 700px) {
    .recent-table thead { display: none; }

    .recent-table,
    .recent-table tbody,
    .recent-table tr,
    .recent-table td {
        display: block;
        width: 100%;
    }

    .recent-table tr {
        border: 1px solid var(--border-neutral);
        border-radius: var(--radius-sm);
        margin-bottom: 0.6rem;
        padding: 0.5rem;
        background: var(--surface-soft);
    }

    .recent-table td {
        border: none;
        padding: 0.4rem 0.5rem;
    }

    .recent-table td::before {
        content: attr(data-label) ": ";
        color: var(--text-muted);
        font-weight: 600;
    }
}

