/**
 * Cats Universe Membership - Frontend CSS
 * Design basierend auf Deck & Wurfmeldung Plugin
 */

/* Container */
.cum-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Success/Error Messages */
.cum-success, .cum-error {
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 32px;
    animation: slideIn 0.4s ease-out;
}

.cum-success {
    background: linear-gradient(135deg, #d4f8e7 0%, #bfe6d9 100%);
    border: 2px solid #86e3ce;
    color: #065f46;
}

.cum-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #fca5a5;
    color: #991b1b;
}

.cum-success-icon, .cum-error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cum-success-icon {
    background: #10b981;
    color: white;
}

.cum-error-icon {
    background: #ef4444;
    color: white;
}

/* Form Wrapper */
.cum-form-wrapper {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Form Header */
.cum-form-header {
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, #1a1d3a 0%, #2d1b4e 100%);
    color: white;
}

.cum-form-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: white;
}

.cum-form-header p {
    margin: 0;
    font-size: 15px;
    opacity: 0.9;
}

/* Progress Bar */
.cum-progress {
    display: flex;
    padding: 24px 32px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    gap: 8px;
}

.cum-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.cum-progress-step.cum-active,
.cum-progress-step.cum-completed {
    opacity: 1;
}

.cum-step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
}

.cum-progress-step.cum-active .cum-step-number {
    background: linear-gradient(135deg, #5b6fd8 0%, #7c5ba5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 111, 216, 0.3);
}

.cum-progress-step.cum-completed .cum-step-number {
    background: #10b981;
    color: white;
}

.cum-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
}

.cum-progress-step.cum-active .cum-step-label,
.cum-progress-step.cum-completed .cum-step-label {
    color: #111827;
}

/* Form Steps */
.cum-form {
    padding: 32px;
    position: relative;
    min-height: 600px;
}

.cum-step {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 32px;
    left: 32px;
    right: 32px;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.cum-step.cum-active {
    visibility: visible;
    opacity: 1;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    pointer-events: auto;
}

.cum-step-title {
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 12px;
    border-bottom: 2px solid #5b6fd8;
}

/* Grid */
.cum-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.cum-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.cum-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Form Fields */
.cum-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cum-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.cum-required {
    color: #ef4444;
}

.cum-help-text {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

/* Inputs */
.cum-input, .cum-select, .cum-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s;
    outline: none;
}

.cum-input:focus, .cum-select:focus, .cum-textarea:focus {
    border-color: #5b6fd8;
    box-shadow: 0 0 0 4px rgba(91, 111, 216, 0.1);
}

/* Validation States */
.cum-input.cum-valid, .cum-select.cum-valid {
    border-color: #10b981;
    background: linear-gradient(135deg, white 0%, #f0fdf4 100%);
}

.cum-input.cum-error, .cum-select.cum-error {
    border-color: #ef4444;
    background: linear-gradient(135deg, white 0%, #fef2f2 100%);
}

.cum-error-message {
    display: none;
    color: #ef4444;
    font-size: 13px;
    margin-top: 4px;
    animation: slideDown 0.3s ease;
}

.cum-error-message.cum-show {
    display: block;
}

/* Disabled State */
.cum-input:disabled, .cum-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.cum-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Radio Cards */
.cum-radio-cards {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.cum-radio-card {
    display: block;
    position: relative;
}

.cum-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cum-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.cum-radio-card input[type="radio"]:checked + .cum-card-content {
    border-color: #5b6fd8;
    background: linear-gradient(135deg, #f0f4ff 0%, #e5edff 100%);
    box-shadow: 0 4px 12px rgba(91, 111, 216, 0.15);
}

.cum-card-content .cum-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.cum-card-content .cum-label {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.cum-card-content .cum-cost-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(91, 111, 216, 0.1);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #5b6fd8;
    align-self: flex-start;
}

/* Cattery Section */
.cum-cattery-section {
    display: none;
    margin-top: 24px;
    padding: 24px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.cum-cattery-section.cum-show {
    display: block;
}

.cum-info-box {
    padding: 16px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #93c5fd;
    border-radius: 10px;
    margin-bottom: 20px;
}

.cum-info-box strong {
    display: block;
    margin-bottom: 8px;
    color: #1e40af;
    font-size: 15px;
}

.cum-info-box p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
    line-height: 1.5;
}

.cum-cattery-name-group {
    margin-bottom: 24px;
    padding: 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
}

.cum-cattery-name-group.cum-optional {
    opacity: 0.8;
}

.cum-cattery-name-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cum-priority {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #5b6fd8 0%, #7c5ba5 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.cum-optional-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.cum-position-radios {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.cum-position-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.cum-position-option:hover {
    border-color: #5b6fd8;
    background: rgba(91, 111, 216, 0.05);
}

.cum-position-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.cum-position-option input[type="radio"]:checked {
    accent-color: #5b6fd8;
}

/* Buttons */
.cum-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.cum-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.cum-btn svg {
    flex-shrink: 0;
}

.cum-btn-primary {
    background: linear-gradient(135deg, #5b6fd8 0%, #7c5ba5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 111, 216, 0.3);
}

.cum-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(91, 111, 216, 0.4);
}

.cum-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.cum-btn-secondary:hover {
    background: #e5e7eb;
}

.cum-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cum-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.cum-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Checkboxes */
.cum-checkbox-group {
    margin-bottom: 16px;
}

.cum-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.cum-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cum-checkbox-custom {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    transition: all 0.2s;
    position: relative;
    margin-top: 2px;
}

.cum-checkbox:checked + .cum-checkbox-custom {
    background: linear-gradient(135deg, #5b6fd8 0%, #7c5ba5 100%);
    border-color: #5b6fd8;
}

.cum-checkbox:checked + .cum-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cum-required-group {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    padding: 16px;
    border-radius: 12px;
}

.cum-required-group .cum-checkbox-label span,
.cum-required-group strong,
.cum-required-group p {
    color: #111827 !important;
    font-weight: 600;
}

/* Price Box */
.cum-price-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #93c5fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.cum-price-box h3,
.cum-price-box p,
.cum-price-box td,
.cum-price-box span,
.cum-price-box strong {
    color: #111827 !important;
}

.cum-price-breakdown {
    margin-top: 16px;
}

.cum-price-table {
    width: 100%;
    border-collapse: collapse;
}

.cum-price-table td {
    padding: 8px 0;
    font-size: 14px;
    color: #111827 !important;
}

.cum-price-value {
    text-align: right;
    font-weight: 600;
}

.cum-total-row td {
    padding-top: 12px;
    border-top: 2px solid #3b82f6;
    font-size: 18px;
    color: #1e40af !important;
    font-weight: 700;
}

.cum-recurring-note {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .cum-container {
        padding: 16px 12px;
    }
    
    .cum-form-wrapper {
        border-radius: 16px;
    }
    
    .cum-form-header {
        padding: 24px 20px;
    }
    
    .cum-form-header h2 {
        font-size: 24px;
    }
    
    .cum-form {
        padding: 24px 20px;
    }
    
    .cum-progress {
        padding: 16px;
        overflow-x: auto;
    }
    
    .cum-step-label {
        font-size: 11px;
    }
    
    .cum-grid-2, .cum-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .cum-actions {
        flex-direction: column;
    }
    
    .cum-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cum-input, .cum-select {
        font-size: 16px; /* Verhindert Auto-Zoom auf iOS */
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
.cum-form.cum-loading {
    pointer-events: none;
    opacity: 0.6;
}

.cum-form.cum-loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 4px solid #e5e7eb;
    border-top-color: #5b6fd8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
