* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Remove iOS button styling */
input, button, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

:root {
    --apple-blue: #007AFF;
    --ocean-blue: #1e3a8a;
    --ocean-blue-light: #3b82f6;
    --apple-green: #34C759;
    --apple-red: #FF3B30;
    --apple-orange: #FF9500;
    --apple-gray: #8E8E93;
    --apple-light-gray: #F2F2F7;
    --apple-dark-gray: #1C1C1E;
    --apple-background: #F5F5F7;
    --apple-card: rgba(255, 255, 255, 0.8);
    --apple-shadow: rgba(0, 0, 0, 0.1);
    --apple-text: #1D1D1F;
    --apple-text-secondary: #86868B;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    min-height: 100vh;
    background: var(--apple-background);
    color: var(--apple-text);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.neutral {
    background: linear-gradient(180deg, #F5F5F7 0%, #E5E5EA 100%);
}

body.uplifting {
    background: linear-gradient(180deg, #E8F5E8 0%, #D1F2D1 100%);
}

body.warning {
    background: linear-gradient(180deg, #FFF2F0 0%, #FFE5E1 100%);
}



.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

header {
    text-align: center;
    margin-bottom: 60px;
    background: linear-gradient(135deg, var(--ocean-blue) 0%, var(--ocean-blue-light) 100%);
    border-radius: 20px;
    padding: 48px 32px;
    box-shadow: 
        0 8px 32px rgba(30, 58, 138, 0.3),
        0 2px 8px rgba(30, 58, 138, 0.2);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

header h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 19px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.agency-name {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin: 8px 0 0 0;
    letter-spacing: -0.02em;
}

main {
    background: var(--apple-card);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 48px;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

main:hover {
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.criteria-container {
    margin-bottom: 40px;
    display: grid;
    gap: 16px;
}

.criteria-item {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.criteria-item:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.criteria-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
}

.criteria-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.criteria-question {
    font-size: 17px;
    font-weight: 500;
    color: var(--apple-text);
    line-height: 1.29412;
    letter-spacing: -0.022em;
}

.criteria-helper {
    font-size: 14px;
    font-weight: 400;
    color: var(--apple-text-secondary);
    line-height: 1.28571;
    letter-spacing: -0.016em;
}

.toggle-switch {
    position: relative;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.criteria-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #E5E5EA;
    transition: background-color 0.15s ease-out;
    border-radius: 15.5px;
    border: 0.5px solid rgba(0, 0, 0, 0.04);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), width 0.15s ease-out;
    border-radius: 50%;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.02);
}

.criteria-checkbox:checked + .toggle-slider {
    background: var(--ocean-blue);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.criteria-checkbox:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-slider:active:before {
    width: 30px;
    transition: transform 0.1s ease-out, width 0.1s ease-out;
}

.criteria-checkbox:checked + .toggle-slider:active:before {
    transform: translateX(17px);
    width: 30px;
    transition: transform 0.1s ease-out, width 0.1s ease-out;
}

/* Add subtle scale feedback on press */
.criteria-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease-out;
}

/* Immediate visual feedback on toggle press */
.toggle-slider:active {
    transform: scale(0.95);
    transition: transform 0.1s ease-out, background-color 0.1s ease-out;
}

/* Remove focus highlights on mobile */
.toggle-slider:focus,
.toggle-slider:focus-visible,
.criteria-checkbox:focus,
.criteria-checkbox:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Improve touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
    .criteria-item {
        padding: 24px;
    }
    
    .toggle-switch {
        width: 60px;
        height: 36px;
    }
    
    .toggle-slider {
        border-radius: 18px;
        transition: background-color 0.1s ease-out;
    }
    
    .toggle-slider:before {
        height: 32px;
        width: 32px;
        left: 2px;
        bottom: 2px;
        transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), width 0.1s ease-out;
    }
    
    .criteria-checkbox:checked + .toggle-slider:before {
        transform: translateX(24px);
    }
    
    .toggle-slider:active:before {
        width: 35px;
        transition: transform 0.05s ease-out, width 0.05s ease-out;
    }
    
    .criteria-checkbox:checked + .toggle-slider:active:before {
        transform: translateX(21px);
        width: 35px;
        transition: transform 0.05s ease-out, width 0.05s ease-out;
    }
    
    /* Enhanced mobile feedback */
    .criteria-item:active {
        transform: scale(0.97);
        transition: transform 0.05s ease-out;
    }
    
    .toggle-slider:active {
        transform: scale(0.92);
        transition: transform 0.05s ease-out, background-color 0.05s ease-out;
    }
}

.button-container {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    font-size: 17px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    letter-spacing: -0.022em;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--apple-blue);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: #0051D5;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: #004CCC;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
    background: rgba(142, 142, 147, 0.12);
    color: var(--apple-text);
    border: 0.5px solid rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: rgba(142, 142, 147, 0.16);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-secondary:active {
    background: rgba(142, 142, 147, 0.2);
    transform: translateY(0);
}

.result-container {
    text-align: center;
    padding: 40px 32px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-top: 24px;
}

.result-container.hidden {
    display: none;
}

.result-container.show {
    animation: resultSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-container.uplifting {
    background: rgba(52, 199, 89, 0.1);
    border-color: rgba(52, 199, 89, 0.2);
}

.result-container.neutral {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.2);
}

.result-container.warning {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.2);
}

.result-container h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--apple-text);
    margin-bottom: 16px;
    letter-spacing: -0.022em;
}

.result-value {
    font-size: 80px;
    font-weight: 700;
    margin: 24px 0;
    letter-spacing: -0.05em;
    line-height: 0.9;
}

.result-value.uplifting {
    color: var(--apple-green);
}

.result-value.neutral {
    color: var(--apple-blue);
}

.result-value.warning {
    color: var(--apple-red);
}

.result-message {
    font-size: 17px;
    font-weight: 400;
    color: var(--apple-text-secondary);
    line-height: 1.47059;
    letter-spacing: -0.022em;
    margin: 0;
}

@keyframes resultSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }
    
    header {
        margin-bottom: 40px;
        padding: 32px 24px;
    }
    
    header h1 {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 17px;
    }
    
    main {
        padding: 32px 24px;
    }
    
    .criteria-item {
        padding: 16px 20px;
    }
    
    .criteria-question {
        font-size: 16px;
    }
    
    .criteria-helper {
        font-size: 13px;
    }
    
    .button-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        width: 100%;
    }
    
    .result-container {
        padding: 32px 24px;
    }
    
    .result-value {
        font-size: 64px;
    }
}