@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #5B2C6F 0%, #7B3E8E 40%, #FF6B4A 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(91, 44, 111, 0.3);
    position: relative;
}

h1 {
    text-align: center;
    margin-bottom: 35px;
    color: #5B2C6F;
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #FF6B4A, #FF8C6B);
    margin: 15px auto 0;
    border-radius: 2px;
}

.required-note {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-bottom: 25px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #5B2C6F;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.char-counter {
    float: right;
    font-size: 11px;
    color: #999;
    font-weight: 400;
    text-transform: none;
}

.validation-status {
    float: right;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    margin-left: 8px;
}

.validation-status.validating {
    color: #FF8C6B;
}

.validation-status.valid {
    color: #4CAF50;
}

.validation-status.invalid {
    color: #FF4444;
}

input[type="text"],
input[type="email"],
input[type="date"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
    background-color: white;
    color: #333;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #FF6B4A;
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.1);
}

select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

input.error,
select.error {
    border-color: #FF4444;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.form-group.highlight {
    animation: highlightError 1s;
}

@keyframes highlightError {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(255, 68, 68, 0.08); }
}

.phone-input {
    display: flex;
    gap: 12px;
}

.phone-input input:first-child {
    flex: 0 0 90px;
}

.phone-input input:last-child {
    flex: 1;
}

.error-message {
    display: block;
    color: #FF4444;
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
}

.terms-group {
    margin: 30px 0 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: #333;
    font-size: 14px;
}

.terms-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #5B2C6F;
    transition: all 0.3s;
}

.terms-label input[type="checkbox"].error {
    outline: 2px solid #FF4444;
    outline-offset: 2px;
}

.terms-group.error-highlight {
    border-color: #FF4444;
    background-color: rgba(255, 68, 68, 0.05);
    animation: shake 0.5s;
}

.terms-label span {
    line-height: 1.6;
}

.terms-label a {
    color: #FF6B4A;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.terms-label a:hover {
    color: #5B2C6F;
    text-decoration: underline;
}

.terms-group .error-message {
    margin-left: 32px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #5B2C6F 0%, #7B3E8E 50%, #FF6B4A 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(91, 44, 111, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 44, 111, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    padding: 14px 24px;
    background: white;
    color: #5B2C6F;
    border: 2px solid #5B2C6F;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

.secondary-btn:hover {
    background: #5B2C6F;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 44, 111, 0.2);
}

.preview-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow-y: auto;
    padding: 30px;
}

.preview-screen.show {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.preview-screen.hidden {
    display: none;
}

.preview-content h2 {
    color: #5B2C6F;
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 25px;
    text-align: center;
}

.preview-data {
    margin-bottom: 30px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-label {
    font-weight: 600;
    color: #5B2C6F;
    font-size: 13px;
    text-transform: uppercase;
}

.preview-value {
    color: #333;
    font-size: 14px;
    text-align: right;
}

.preview-actions,
.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.success-actions {
    margin-top: 10px;
}

.success-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow-y: auto;
    padding: 30px;
}

.success-screen.show {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.success-screen.hidden {
    display: none;
}

.success-content {
    text-align: center;
    padding: 20px 0 40px 0;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #5B2C6F, #FF6B4A);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: white;
    animation: scaleIn 0.5s ease-out 0.2s both;
    font-weight: bold;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-content h2 {
    color: #5B2C6F;
    margin-bottom: 15px;
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
}

.success-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    font-weight: 500;
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        margin: 30px auto;
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 24px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    label {
        font-size: 13px;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 12px 14px;
        font-size: 14px;
    }

    .phone-input {
        gap: 10px;
    }

    .phone-input input:first-child {
        flex: 0 0 80px;
    }

    .terms-group {
        padding: 15px;
        margin: 25px 0 15px 0;
    }

    .terms-label {
        font-size: 13px;
    }

    .submit-btn,
    .secondary-btn {
        padding: 14px;
        font-size: 15px;
    }

    .preview-screen,
    .success-screen {
        padding: 20px;
    }

    .preview-content h2,
    .success-content h2 {
        font-size: 22px;
    }

    .preview-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 10px 0;
    }

    .preview-value {
        text-align: left;
    }

    .preview-actions {
        flex-direction: column;
        gap: 10px;
    }

    .preview-actions .secondary-btn,
    .preview-actions .submit-btn {
        width: 100%;
    }
    
    .success-content {
        padding: 20px;
    }
    
    .success-icon {
        width: 80px;
        height: 80px;
        font-size: 44px;
    }

    .error-modal-content {
        padding: 30px 20px;
    }

    .error-icon {
        width: 80px;
        height: 80px;
        font-size: 44px;
    }

    .error-modal-content h2 {
        font-size: 24px;
    }

    .error-modal-content p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 15px auto;
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 20px;
    }

    h1::after {
        width: 60px;
        height: 3px;
        margin: 12px auto 0;
    }

    .required-note {
        font-size: 12px;
    }

    label {
        font-size: 12px;
    }

    .char-counter,
    .validation-status {
        font-size: 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 10px 12px;
        font-size: 13px;
    }

    .phone-input input:first-child {
        flex: 0 0 70px;
    }

    .error-message {
        font-size: 11px;
    }

    .terms-group {
        padding: 12px;
    }

    .terms-label {
        font-size: 12px;
    }

    .terms-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .submit-btn,
    .secondary-btn {
        padding: 12px;
        font-size: 14px;
    }

    .preview-content h2,
    .success-content h2 {
        font-size: 20px;
    }

    .preview-label,
    .preview-value {
        font-size: 12px;
    }

    .success-icon {
        width: 70px;
        height: 70px;
        font-size: 36px;
    }

    .success-content p {
        font-size: 14px;
    }

    .error-icon {
        width: 70px;
        height: 70px;
        font-size: 36px;
    }

    .error-modal-content h2 {
        font-size: 20px;
    }

    .error-modal-content p {
        font-size: 14px;
    }

    .page-footer {
        padding: 8px 15px;
    }

    .admin-link {
        padding: 4px 8px;
        font-size: 8px;
    }
}

.submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.submit-btn.validating {
    background: linear-gradient(135deg, #FF8C6B 0%, #FF6B4A 100%);
    cursor: wait;
}

.submit-btn.validating::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

input.validating,
select.validating {
    border-color: #FF8C6B !important;
    background-color: #FFF9F7 !important;
}

.validation-help {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    color: #999;
    cursor: help;
    font-size: 14px;
}

.validation-help:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #333;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.validation-help:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.page-footer {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 20px;
    text-align: left;
}

.admin-link {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.3);
    color: rgba(91, 44, 111, 0.4);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 400;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 1px solid rgba(91, 44, 111, 0.2);
    opacity: 0.3;
}

.admin-link::before {
    content: "";
}

.admin-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.9);
    color: #5B2C6F;
    border-color: #5B2C6F;
}

.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.error-modal.show {
    opacity: 1;
    visibility: visible;
}

.error-modal.hidden {
    display: none;
}

.error-modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease-out;
}

.error-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #F44336, #E53935);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: white;
    font-weight: bold;
}

.error-modal-content h2 {
    color: #F44336;
    margin-bottom: 15px;
    font-size: 28px;
    font-weight: 800;
}

.error-modal-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

.error-modal-content .submit-btn {
    width: auto;
    min-width: 150px;
}