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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #667eea;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

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

header h1 {
    color: white;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.card h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 1.75rem;
}

.subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
}

.project-select {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    position: relative;
}

.project-card:hover {
    border-color: #667eea;
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
}

.project-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.project-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.project-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 8px;
}

.project-desc {
    font-size: 1rem;
    color: #718096;
    text-align: center;
}

.project-header {
    text-align: center;
    margin-bottom: 25px;
}

.project-badge {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.device-select {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.device-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.device-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.device-card input[type="radio"] {
    display: none;
}

.device-card input[type="radio"]:checked + .device-icon + .device-name + .device-desc,
.device-card input[type="radio"]:checked ~ .device-icon {
    color: #667eea;
}

.device-card input[type="radio"]:checked + .device-icon {
    transform: scale(1.1);
}

.device-card input[type="radio"]:checked ~ * {
    border-color: #667eea;
}

.device-card:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #ebf4ff;
}

.device-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.device-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2d3748;
}

.device-desc {
    color: #718096;
    font-size: 0.95rem;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    width: 100%;
    margin-top: 10px;
}

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

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.step.active {
    background: #667eea;
    color: white;
}

.line {
    flex: 0 1 60px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
}

.agreement-box {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    background: #f7fafc;
}

.agreement-box::-webkit-scrollbar {
    width: 8px;
}

.agreement-box::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.agreement-box::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 4px;
}

.agreement-content h3 {
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
}

.agreement-content h4 {
    color: #4a5568;
    margin: 20px 0 10px;
    font-size: 1.1rem;
}

.agreement-content p {
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 10px;
    text-align: justify;
}

.sign-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2d3748;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    color: #4a5568;
    line-height: 1.5;
}

.signature-group {
    margin-top: 10px;
}

.signature-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #ffffff;
    border: 3px dashed #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.3s ease;
}

.signature-container:hover {
    border-color: #667eea;
}

#signatureCanvas {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
    max-width: 100%;
    background: white;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.alert.error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

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

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: #48bb78;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.info-box {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.info-box p {
    margin-bottom: 10px;
    color: #4a5568;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box.highlight {
    background: #ebf4ff;
    border-color: #667eea;
}

.download-section,
.testflight-section {
    margin: 30px 0;
    padding: 25px;
    background: #ebf4ff;
    border-radius: 12px;
    border: 2px dashed #667eea;
}

.download-section h3,
.testflight-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
}

.hint {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 15px;
}

.apple-id-display {
    font-size: 1.2rem;
    color: #667eea;
    margin-top: 10px;
}

.tutorial-section {
    margin: 30px 0;
    text-align: left;
}

.tutorial-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 1.5rem;
}

.tutorial-box {
    max-height: 600px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    background: #f7fafc;
}

.tutorial-box::-webkit-scrollbar {
    width: 8px;
}

.tutorial-box::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.tutorial-box::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.tutorial-content h3 {
    color: #2d3748;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.4rem;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tutorial-step {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.step-content p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 5px;
}

.step-content p:last-child {
    margin-bottom: 0;
}

.step-content .note {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 10px 12px;
    margin-top: 10px;
    border-radius: 0 6px 6px 0;
    color: #856404;
    font-size: 0.9rem;
}

.troubleshooting {
    margin-top: 30px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 12px;
    border: 2px solid #ffc107;
}

.troubleshooting h4 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.troubleshooting ul {
    list-style: none;
    padding: 0;
}

.troubleshooting li {
    color: #856404;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(133, 100, 4, 0.2);
}

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

.troubleshooting li strong {
    color: #664d03;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 25px;
    }
    
    .card h2 {
        font-size: 1.4rem;
    }
    
    .device-icon {
        font-size: 3rem;
    }
    
    .agreement-box {
        max-height: 300px;
    }
    
    .tutorial-box {
        max-height: 450px;
        padding: 15px;
    }
    
    .tutorial-step {
        padding: 15px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: white;
}

.footer-content {
    opacity: 0.9;
}

.footer-content p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.footer-content .developer-name {
    font-weight: bold;
    font-size: 1rem;
}
