/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 520px;
}

.form-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px 36px;
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* ========== Header ========== */
.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-header h1 {
    font-size: 22px;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-weight: 700;
}

.form-header .subtitle {
    font-size: 14px;
    color: #888;
}

/* ========== Form Groups ========== */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 7px;
}

.required {
    color: #e74c3c;
    margin-right: 2px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s ease;
    background: #fafafa;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #bbb;
}

.form-group 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='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ========== Agreement Section ========== */
.agreement-section {
    margin-top: 6px;
}

.agreement-label {
    display: flex !important;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 400 !important;
    user-select: none;
}

.agreement-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
    margin-top: 1px;
    position: relative;
    transition: all 0.3s ease;
    background: #fafafa;
}

.agreement-label input:checked ~ .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.agreement-label input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.agreement-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.agreement-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.agreement-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ========== Submit Button ========== */
.submit-btn {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== Toast ========== */
.toast {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #27ae60;
    color: #fff;
    padding: 16px 30px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(39, 174, 96, 0.4);
    z-index: 10;
    white-space: nowrap;
}

.toast.show {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInUp 0.4s ease;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ========== Modal ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 620px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    z-index: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 18px;
    color: #1a1a2e;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: #e74c3c;
    color: #fff;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
    color: #444;
    font-size: 14px;
}

.modal-body h3 {
    font-size: 15px;
    color: #1a1a2e;
    margin: 16px 0 6px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 8px;
    text-indent: 2em;
}

.modal-body .highlight {
    color: #667eea;
    font-weight: 600;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    text-align: center;
    flex-shrink: 0;
}

.btn-confirm {
    padding: 10px 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .form-card {
        padding: 28px 20px;
        border-radius: 12px;
    }
    .form-header h1 {
        font-size: 19px;
    }
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
}

/* ========== Error State ========== */
.form-group input.error,
.form-group select.error {
    border-color: #e74c3c;
    background: #fff5f5;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.error-message.show {
    display: block;
}
