/* ==========================================================================
   GLOBAL DESIGN VARIABLES & BASE RESET
   ========================================================================== */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #cbd5e1;
    --error: #dc2626;
    --error-bg: #fef2f2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* Baseline typography for the whole app */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    
    min-height: 100vh;
}

/* ==========================================================================
   2. MASTER CONTENT CONTAINER (.app-container)
   ========================================================================== */
.app-container {

    /* Full viewport height alignment */
    min-height: 100vh;
    width: 100%;

    /* Center view cards vertically and horizontally */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Gutter spacing around views on small screens */
    padding: 2rem 1rem;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
    background: var(--card-bg);
    width: 100%;
    max-width: 680px;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.card-header {
    margin-bottom: 2rem;
    text-align: center;
}

.card-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.card-header p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   ALERT MESSAGES
   ========================================================================== */
.alert-error {
    background-color: var(--error-bg);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error ul {
    margin-left: 1.25rem;
}

/* ==========================================================================
   RESPONSIVE GRID LAYOUTS
   ========================================================================== */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .col-span-2 {
        grid-column: span 2;
    }
}

/* ==========================================================================
   FORM CONTROLS & INPUTS
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

input,
select {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Subdomain Prefix Group */
.subdomain-input-group {
    display: flex;
    align-items: center;
}

.subdomain-input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.subdomain-suffix {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-left: none;
    padding: 0.65rem 0.75rem;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    font-size: 0.875rem;
    color: var(--muted);
    white-space: nowrap;
}

/* ==========================================================================
   BUTTONS & FOOTER
   ========================================================================== */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}