:root {
    --bg-color: #0f111a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --blob-1: #4f46e5;
    --blob-2: #ec4899;
    --blob-3: #8b5cf6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

body.backoffice {
    align-items: flex-start;
    padding: 40px 0;
}

/* Background Animations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--blob-1);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: var(--blob-2);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: var(--blob-3);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone svg {
    color: var(--text-secondary);
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.drop-zone:hover svg, .drop-zone.dragover svg {
    color: var(--primary-color);
}

.drop-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.drop-text span {
    color: var(--primary-color);
    font-weight: 600;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 10px;
}

.hidden {
    display: none !important;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary-color);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-small {
    width: auto;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}
.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
}

.btn-icon:hover {
    color: var(--danger-color);
}

/* Captcha styling */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-svg-container {
    flex-shrink: 0;
    height: 40px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
}

.captcha-svg-container svg {
    display: block;
    height: 100%;
    width: auto;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    height: 40px;
    width: 40px;
    flex-shrink: 0;
}

.btn-refresh:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-refresh svg {
    transition: transform 0.4s ease;
}

.btn-refresh:hover svg {
    transform: rotate(180deg);
}

#captchaInput {
    flex-grow: 1;
    height: 40px;
    padding: 8px 16px;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

#captchaInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}


.status-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dashboard specific */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.container.wide {
    max-width: 95%;
}

.glass-panel h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

td {
    font-size: 0.9rem;
    vertical-align: middle;
}

.text-center {
    text-align: center;
}

.actions {
    display: flex;
    gap: 8px;
}

a.btn-small {
    text-decoration: none;
    display: inline-block;
}

/* Backoffice Header & Auth Controls */
.backoffice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.backoffice-header .header-titles {
    text-align: left;
}

.backoffice-header .logo {
    margin-bottom: 4px;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Backoffice Login Panel */
.login-panel {
    max-width: 440px;
    margin: 40px auto;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
