@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;600&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --black: #111111;
    --dark: #1c1c1c;
    --gray-900: #2a2a2a;
    --gray-600: #6b6b6b;
    --gray-300: #d8d8d8;
    --gray-100: #f4f4f2;
    --white: #ffffff;
    --error: #b3261e;
    --success: #2c6e49;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--black);
    -webkit-tap-highlight-color: transparent;
}

/* ---------- LOGIN ---------- */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--black);
    padding: 24px;
}

.login-panel {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 36px 28px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand h1 {
    font-family: 'Source Serif 4', serif;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 4px;
    letter-spacing: 0.01em;
}

.brand .subtitle {
    margin: 0 0 28px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.pin-display {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pin-dot.filled {
    background: var(--black);
    border-color: var(--black);
    transform: scale(1.05);
}

.pin-dot.shake-error {
    border-color: var(--error);
}

.login-error {
    color: var(--error);
    font-size: 0.85rem;
    min-height: 1.2em;
    margin: 14px 0 4px;
}

.numpad {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.numpad-btn {
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 500;
    padding: 18px 0;
    border-radius: 12px;
    border: 1px solid var(--gray-300);
    background: var(--gray-100);
    color: var(--black);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.1s ease, transform 0.05s ease;
}

.numpad-btn:active {
    background: var(--gray-300);
    transform: scale(0.96);
}

.numpad-action {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    background: transparent;
    border-color: transparent;
}

.shake {
    animation: shake 0.35s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* ---------- MAIN ---------- */

.main-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: var(--black);
    color: var(--white);
    padding: 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-300);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.top-bar-delegacion {
    font-family: 'Source Serif 4', serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2px 0 0;
}

.logout-btn {
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--gray-300);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
}

.logout-btn:active {
    background: rgba(255,255,255,0.1);
}

.ticket-panel {
    flex: 1;
    padding: 24px 20px 40px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.field {
    margin-bottom: 22px;
}

.field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.required {
    color: var(--error);
}

.field input[type="text"],
.field textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--black);
    resize: vertical;
}

.field input[type="text"]:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--black);
}

.photo-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 28px 16px;
    cursor: pointer;
    background: var(--white);
    min-height: 140px;
    text-align: center;
}

.photo-picker-icon {
    font-size: 2rem;
}

.photo-picker-text {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.photo-preview {
    max-width: 100%;
    max-height: 260px;
    border-radius: 10px;
    object-fit: cover;
}

.form-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.form-success {
    color: var(--success);
    font-size: 0.9rem;
    margin-bottom: 14px;
    font-weight: 600;
}

.submit-btn {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 16px;
    border-radius: 12px;
    border: none;
    background: var(--black);
    color: var(--white);
    cursor: pointer;
}

.submit-btn:active {
    background: var(--gray-900);
}

.submit-btn:disabled {
    background: var(--gray-300);
    color: var(--gray-600);
    cursor: not-allowed;
}
