/* ============================================
   Generator Cereri MoldATSA — Stiluri
   ============================================ */

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --accent: #e67e22;
    --accent-light: #f39c12;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dce1e8;
    --success: #27ae60;
    --danger: #e74c3c;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    padding: 30px 20px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

header p {
    opacity: 0.9;
    font-size: 1rem;
}

/* Profile bar */
.profile-bar {
    background: #eafaf1;
    border: 1px solid var(--success);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    color: #1e8449;
}

/* Form */
.flight-form {
    background: var(--card-bg);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px 30px;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    padding: 0 10px;
}

.fieldset-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 14px;
}

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

.form-row .form-group {
    flex: 1;
    min-width: 180px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text);
}

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

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

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
    background: #fff;
}

input[readonly] {
    background: #f0f0f0;
    cursor: default;
}

textarea {
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.1s;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary:hover {
    background: #154360;
}

.btn-secondary {
    background: #ecf0f1;
    color: var(--text);
}

.btn-secondary:hover {
    background: #d5dbdb;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: #d35400;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.85rem;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-small:hover {
    background: #c0392b;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* Hartă */
.map-container {
    height: 450px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin-bottom: 10px;
    z-index: 1;
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.map-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

.map-coords-info {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 8px;
}

.coords-raw {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Geoportal status */
.geoportal-controls {
    margin-top: 14px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.geoportal-controls h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.geoportal-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-top: 6px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    background: #bdc3c7;
}

.status-indicator.loading {
    background: var(--accent);
    animation: pulse 1s infinite;
}

.status-indicator.loaded {
    background: var(--success);
}

.status-indicator.error {
    background: var(--danger);
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Result area */
.result-area {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: 20px;
}

.result-area h2 {
    color: var(--success);
    margin-bottom: 12px;
}

.pdf-links a {
    display: inline-block;
    margin: 6px 12px 6px 0;
    padding: 10px 20px;
    background: var(--success);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}

.pdf-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pdf-actions .btn {
    padding: 10px 18px;
    font-size: 0.95rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    font-family: inherit;
}

.pdf-actions .btn-primary {
    background: var(--primary);
    color: #fff;
}

.pdf-actions .btn-primary:hover {
    background: #154360;
}

.pdf-actions .btn-secondary {
    background: #ecf0f1;
    color: var(--text);
}

.pdf-actions .btn-secondary:hover {
    background: #d5dbdb;
}

.pdf-actions .btn-accent {
    background: var(--accent);
    color: #fff;
}

.pdf-actions .btn-accent:hover {
    background: #d35400;
}

@media (max-width: 600px) {
    .pdf-actions {
        flex-direction: column;
    }
    .pdf-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
    font-size: 1.2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    header h1 {
        font-size: 1.4rem;
    }
    .form-row {
        flex-direction: column;
    }
    .form-row .form-group {
        min-width: unset;
    }
    .map-container {
        height: 300px;
    }
    .form-actions {
        flex-direction: column;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
}
