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

:root {
    --primary-color: #93ee6f;
    --primary-dark: #3d4a38;
    --accent-color: #9caa8c;
    --accent-dark: #7d8c6e;
    --success-color: #8a9f7c;
    --error-color: #c47c7c;
    --warning-color: #c9a86c;
    --background: #f5f7f3;
    --card-bg: #ffffff;
    --text-color: #3d4a38;
    --text-light: #6b7c64;
    --border-color: #d4ddd0;
    --gradient-start: #93ee6f;
    --gradient-end: #f7e4f3;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 40px;
    margin-bottom: 20px;
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.card-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-dark);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(156, 170, 140, 0.15);
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    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='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(125, 140, 110, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary-dark);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions .btn-primary {
    flex: 1;
    min-width: 150px;
}

.form-actions .btn-secondary {
    flex: 0 0 auto;
}

.radio-group {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.radio-option label {
    display: block;
    padding: 16px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.radio-option input[type="radio"]:checked + label {
    border-color: var(--accent-color);
    background: rgba(156, 170, 140, 0.15);
    color: var(--accent-color);
}

.radio-option input[type="radio"]:focus + label {
    box-shadow: 0 0 0 3px rgba(156, 170, 140, 0.25);
}

.event-details {
    background: linear-gradient(135deg, #f5f7f3 0%, #eef2ea 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.event-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 16px;
    word-wrap: break-word;
}

.event-info {
    display: grid;
    gap: 12px;
}

.event-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.event-info-item .icon {
    font-size: 1.2rem;
    min-width: 24px;
    flex-shrink: 0;
}

.event-info-item .label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-info-item .value {
    color: var(--text-color);
    word-wrap: break-word;
}

/* RSVP Status Display */
.rsvp-status {
    background: linear-gradient(135deg, #f0f4ed 0%, #e8efe4 100%);
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.rsvp-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.rsvp-status-header h3 {
    color: var(--primary-dark);
    margin: 0;
}

.rsvp-status-content {
    display: grid;
    gap: 12px;
}

.rsvp-status-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rsvp-status-label {
    font-weight: 600;
    color: var(--text-light);
    min-width: 120px;
}

.rsvp-status-value {
    color: var(--text-color);
    word-wrap: break-word;
    flex: 1;
}

.rsvp-status-value.attending {
    color: var(--success-color);
    font-weight: 600;
}

.rsvp-status-value.not-attending {
    color: var(--text-light);
    font-weight: 600;
}

.plus-ones-list {
    list-style: none;
    margin: 8px 0 0 0;
    padding-left: 128px;
}

.plus-ones-list li {
    padding: 4px 0;
    color: var(--text-color);
}

.plus-ones-list li::before {
    content: "- ";
    color: var(--text-light);
}

.plus-ones-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.plus-ones-section h3 {
    margin-bottom: 16px;
    color: var(--primary-dark);
}

.plus-one-fields {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.plus-one-field {
    display: none;
}

.plus-one-field.visible {
    display: block;
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: rgba(138, 159, 124, 0.15);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.alert-error {
    background: rgba(196, 124, 124, 0.15);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.alert-warning {
    background: rgba(201, 168, 108, 0.15);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.errors {
    background: rgba(196, 124, 124, 0.15);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.errors ul {
    list-style: none;
    color: var(--error-color);
}

.confirmation-card {
    text-align: center;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
    color: white;
}

.confirmation-icon.declined {
    background: var(--text-light);
}

.confirmation-title {
    font-size: 1.75rem;
    margin-bottom: 16px;
    color: var(--primary-dark);
}

.confirmation-message {
    color: var(--text-light);
    margin-bottom: 24px;
}

.confirmation-details {
    text-align: left;
    background: var(--background);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.confirmation-details h4 {
    margin-bottom: 12px;
    color: var(--primary-dark);
}

.confirmation-details ul {
    list-style: none;
}

.confirmation-details li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    word-wrap: break-word;
}

.confirmation-details li:last-child {
    border-bottom: none;
}

.event-select-list {
    list-style: none;
}

.event-select-item {
    margin-bottom: 16px;
}

.event-select-button {
    width: 100%;
    padding: 20px;
    text-align: left;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.event-select-button:hover {
    border-color: var(--accent-color);
    background: rgba(156, 170, 140, 0.1);
}

.event-select-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.event-select-date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

.welcome-text {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.back-link {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    margin-top: 20px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    .card {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .card-header h1 {
        font-size: 1.5rem;
    }

    .event-name {
        font-size: 1.25rem;
    }

    .event-details {
        padding: 16px;
    }

    .radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .radio-option label {
        padding: 14px;
    }

    .btn {
        padding: 12px 20px;
    }

    .rsvp-status {
        padding: 16px;
    }

    .rsvp-status-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rsvp-status-item {
        flex-direction: column;
        gap: 4px;
    }

    .rsvp-status-label {
        min-width: auto;
    }

    .plus-ones-list {
        padding-left: 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-secondary {
        width: 100%;
    }

    .confirmation-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .confirmation-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 20px 16px;
    }

    .card-header h1 {
        font-size: 1.35rem;
    }

    .event-details,
    .rsvp-status {
        padding: 14px;
    }

    .form-control,
    .form-select {
        padding: 12px 14px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }

    .btn-primary:active {
        background: var(--accent-dark);
    }

    .radio-option label {
        padding: 18px;
    }
}
