﻿/* MapleStack Site Provisioner v4.0.0 — Standalone Page */

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

html, body {
    width: 100%; min-height: 100%;
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.maplestack-form-wrapper {
    max-width: 560px;
    width: 100%;
    padding: 36px 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.maplestack-form-wrapper h2 {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 6px;
}

.maplestack-form-wrapper > p {
    color: #777;
    text-align: center;
    font-size: 14px;
    margin-bottom: 28px;
}

.maplestack-form-wrapper form { margin: 0; padding: 0; }
.maplestack-field { margin-bottom: 18px; }
.maplestack-field label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; color: #333; }

.maplestack-field input[type="text"],
.maplestack-field input[type="email"] {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    color: #222;
    background: #fafafa;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}

.maplestack-field input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
    background: #fff;
}

.maplestack-url-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
}

.maplestack-url-input:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
    background: #fff;
}

.maplestack-url-input input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 42px;
    padding: 0 14px;
    font-size: 15px;
    color: #222;
    outline: none;
}

.maplestack-domain {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #f0f0f0;
    color: #888;
    font-size: 13px;
    white-space: nowrap;
    border-left: 1px solid #ddd;
    -webkit-user-select: none;
    user-select: none;
}

.maplestack-submit-btn {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 8px;
    padding: 0 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
    line-height: 48px;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}

.maplestack-submit-btn:hover { opacity: .92; transform: translateY(-1px); }
.maplestack-submit-btn:active { transform: translateY(0); }
.maplestack-submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.maplestack-submit-btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.maplestack-submit-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 22px; height: 22px;
    margin: -11px 0 0 -11px;
    border: 3px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ms-spin .7s linear infinite;
}
@keyframes ms-spin { to { transform: rotate(360deg); } }

.maplestack-result { margin-top: 16px; padding: 14px 16px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.maplestack-result.success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.maplestack-result.error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.maplestack-result a { color: #667eea; font-weight: 600; text-decoration: none; }
.maplestack-result a:hover { text-decoration: underline; }

@media (max-width: 540px) {
    .maplestack-form-wrapper { padding: 24px 20px; border-radius: 12px; }
    .maplestack-url-input { flex-direction: column; }
    .maplestack-domain { border-left: none; border-top: 1px solid #ddd; justify-content: center; padding: 8px; }
    .maplestack-template-grid { grid-template-columns: 1fr; }
}

/* ── Template Selection ── */
.maplestack-template-section {
    margin-bottom: 24px;
}

.maplestack-section-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.maplestack-template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.maplestack-template-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    background: #fff;
    position: relative;
}

.maplestack-template-card:hover {
    border-color: #b8c4ff;
    transform: translateY(-1px);
}

.maplestack-template-card.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.2);
    background: #f8f9ff;
}

.maplestack-template-card.is-pro-locked {
    opacity: .55;
    cursor: default;
}

.maplestack-template-card.is-pro-locked:hover {
    border-color: #e8e8e8;
    transform: none;
}

.maplestack-template-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.maplestack-template-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.maplestack-template-info strong {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    display: flex;
    align-items: center;
    gap: 6px;
}

.maplestack-template-info small {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
}

.maplestack-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: .5px;
    flex-shrink: 0;
}
