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

:root {
    --primary: #00bcd4;
    --primary-dim: rgba(0, 188, 212, 0.15);
    --primary-glow: rgba(0, 188, 212, 0.25);
    --accent: #f5c518;
    --accent-hover: #e0b414;
    --accent-dim: rgba(245, 197, 24, 0.12);
    --bg: #0a0a12;
    --bg-elevated: #12121e;
    --card: #16162a;
    --card-hover: #1c1c36;
    --text: #e8e6e1;
    --text-secondary: #9a97a0;
    --text-muted: #5e5c66;
    --success: #25d366;
    --error: #ef4444;
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 188, 212, 0.5);
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ─── Header ─────────────────────────────────────────────────── */
header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 6px;
    font-weight: 400;
}

/* ─── Main ───────────────────────────────────────────────────── */
main {
    flex: 1;
    padding: 36px 0;
}

/* ─── Fieldsets ──────────────────────────────────────────────── */
fieldset {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

fieldset:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

fieldset legend {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ─── Form elements ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: var(--bg-elevated);
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239a97a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select option {
    background: var(--card);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-dim);
    background: var(--bg);
}

textarea {
    resize: vertical;
}

/* ─── Radio buttons ──────────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 12px;
    padding-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text);
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    background: var(--bg-elevated);
}

.radio-label:hover {
    border-color: var(--primary);
    background: var(--primary-dim);
}

input[type="radio"] {
    accent-color: var(--primary);
}

input[type="radio"]:checked + .radio-label,
.radio-label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-dim);
    color: var(--primary);
}

/* ─── Checkboxes grid ────────────────────────────────────────── */
.amenidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.checkbox-label:hover {
    background: var(--primary-dim);
    border-color: var(--border);
    color: var(--text);
}

input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* ─── File input ─────────────────────────────────────────────── */
input[type="file"] {
    padding: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-dim);
}

/* ─── Photo preview ──────────────────────────────────────────── */
.foto-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.foto-preview .thumb {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}

.foto-preview .thumb:hover {
    border-color: var(--primary);
}

.foto-preview .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-preview .thumb .badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: white;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    display: block;
    width: 100%;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--primary), #0097a7);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(0, 188, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 188, 212, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

.btn-copy {
    padding: 6px 18px;
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-publish-ig {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-publish-ig:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.btn-publish-ig:active {
    transform: translateY(0);
}

.btn-publish-ig:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.publish-msg {
    display: none;
    text-align: center;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.publish-success {
    background: rgba(37, 211, 102, 0.1);
    color: var(--success);
    border: 1px solid rgba(37, 211, 102, 0.3);
}

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

.video-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    text-align: center;
}

.btn-video {
    display: block;
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent), #e0a800);
    color: #0a0a12;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(245, 197, 24, 0.25);
}

.btn-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(245, 197, 24, 0.35);
}

.btn-video-dl {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent), #e0a800);
    color: #0a0a12;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-video-dl:hover {
    transform: translateY(-2px);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

#video-progress p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Loading ────────────────────────────────────────────────── */
.loading-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.loading-overlay p {
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ─── Error ──────────────────────────────────────────────────── */
.error-alert {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* ─── Results ────────────────────────────────────────────────── */
#resultados {
    display: none;
}

#resultados h2 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 28px;
    font-size: 1.8rem;
    font-weight: 800;
}

.portada-container {
    margin-bottom: 24px;
    text-align: center;
}

.portada-container img {
    max-width: 100%;
    max-height: 420px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.galeria-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.galeria-container img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
}

.galeria-container img:hover {
    transform: scale(1.03);
    border-color: var(--primary);
}

.result-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.result-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-header h3 {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-content {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--card);
    color: var(--primary);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-pdf:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-pdf:active {
    transform: translateY(0);
}

.btn-ig {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-ig:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.btn-ig:active {
    transform: translateY(0);
}

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

.ig-preview img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.result-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
    font-size: 0.8rem;
    margin-top: auto;
    letter-spacing: 0.5px;
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .amenidades-grid {
        grid-template-columns: 1fr 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions a,
    .result-actions button {
        width: 100%;
        justify-content: center;
    }

    header h1 {
        font-size: 1.8rem;
    }

    fieldset {
        padding: 20px;
    }

    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
}
