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

/* ─── Base ────────────────────────────────────────────────────────────────── */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #3558a2 0%, #2a4580 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ─── Card container ──────────────────────────────────────────────────────── */
.container {
    max-width: 620px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
.header {
    background: linear-gradient(135deg, #3558a2 0%, #4a6bb5 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 8px;
}

.header p {
    font-size: 15px;
    opacity: 0.88;
}

.logo-container {
    margin-bottom: 18px;
}

.logo {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.logo img {
    height: auto;
    width: 120px;
    filter: brightness(0) invert(1);
    vertical-align: middle;
}

/* ─── Form container ──────────────────────────────────────────────────────── */
.form-container {
    padding: 36px 40px 44px;
}

div:has(> #website) {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

#website {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    padding: 0;
}

/* ─── Notice banner ───────────────────────────────────────────────────────── */
.setup-notice {
    background: #e8f0ff;
    color: #2a4580;
    padding: 18px 20px;
    margin-bottom: 28px;
    border-radius: 10px;
    border: 1px solid #c5d5f5;
    font-size: 14px;
    line-height: 1.6;
}

.setup-notice h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

/* ─── Form groups ─────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 22px;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ─── Labels ──────────────────────────────────────────────────────────────── */
label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.required {
    color: #dc3545;
    margin-left: 2px;
}

/* ─── Inputs & selects ────────────────────────────────────────────────────── */
input,
select {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 15px;
    color: #333;
    background: white;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
}

/* Custom arrow for selects */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

select:disabled {
    background-color: #f8f9fa;
    color: #aaa;
    cursor: not-allowed;
    border-color: #e9ecef;
}

input:focus,
select:focus {
    outline: none;
    border-color: #3558a2;
    box-shadow: 0 0 0 3px rgba(53, 88, 162, 0.12);
}

input::placeholder {
    color: #bbb;
    font-weight: 400;
}

/* ─── Inline field errors ─────────────────────────────────────────────────── */
.field-error {
    display: none;
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: #c0392b;
}

.field-error.visible {
    display: block;
}

input.input-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* ─── Submit button ───────────────────────────────────────────────────────── */
.btn {
    background: linear-gradient(135deg, #3558a2 0%, #4a6bb5 100%);
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
    width: 100%;
    margin-top: 6px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(53, 88, 162, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Loading spinner ─────────────────────────────────────────────────────── */
.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3558a2;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 12px;
}

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

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .form-container {
        padding: 24px 20px 32px;
    }

    .header h1 {
        font-size: 1.6em;
    }

    .row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
