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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 22px;
    margin-bottom: 5px;
}

.header .subtitle {
    opacity: 0.9;
    font-size: 12px;
}

.content {
    padding: 25px;
}

.progress-bar {
    height: 5px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.step-info {
    text-align: center;
    margin-bottom: 15px;
    color: #6b7280;
    font-size: 13px;
}

.step-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 13px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.radio-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.radio-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
    font-weight: 600;
}

.info-box {
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    padding: 10px 12px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 13px;
}

.info-box.success {
    background: #f0fdf4;
    border-left-color: #10b981;
    color: #065f46;
}

.info-box.error {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.info-box.warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.tolerance-box {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.tolerance-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

.tolerance-row:last-child {
    border-bottom: none;
}

.tolerance-label {
    color: #6b7280;
    font-weight: 500;
}

.tolerance-value {
    font-weight: 700;
    color: #1f2937;
    font-size: 15px;
}

.pore-hint {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border: 2px solid #3b82f6;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.pore-hint-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
}

.pore-hint-value {
    font-size: 28px;
    font-weight: 900;
    color: #1e3a8a;
    margin: 8px 0;
}

.pore-hint-calc {
    font-size: 11px;
    color: #60a5fa;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

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

.result-card {
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 15px;
    border: 3px solid;
}

.result-card.success {
    border-color: #10b981;
    background: linear-gradient(to bottom, #f0fdf4, white);
}

.result-card.error {
    border-color: #ef4444;
    background: linear-gradient(to bottom, #fef2f2, white);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.result-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    flex-shrink: 0;
}

.result-icon.success {
    background: #10b981;
}

.result-icon.error {
    background: #ef4444;
}

.result-title {
    font-size: 26px;
    font-weight: 700;
}

.result-title.success {
    color: #065f46;
}

.result-title.error {
    color: #991b1b;
}

.result-reason {
    font-size: 14px;
    margin-top: 5px;
    color: #4b5563;
}

.result-details {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 12px;
}

.result-detail-item {
    padding: 10px;
    margin-bottom: 6px;
    background: #f9fafb;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.result-detail-item.fail {
    background: #fee2e2;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.config-box {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.config-title {
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
    font-size: 12px;
}

#error-box {
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #991b1b;
}

#error-box strong {
    display: block;
    margin-bottom: 8px;
}
