/* Casey Web App - Styles */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #82c7a5;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
}

/* Remaining Badge */
.remaining-badge {
    background: rgba(130, 199, 165, 0.15);
    border: 1px solid #82c7a5;
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    margin-bottom: 30px;
    color: #82c7a5;
    font-size: 0.95rem;
}

.remaining-badge span {
    font-weight: 700;
    font-size: 1.2rem;
}

/* Form */
.erb-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e0e0e0;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #82c7a5;
    background: rgba(130, 199, 165, 0.1);
}

.form-group input::placeholder {
    color: #666;
}

.form-group select option {
    background: #1a1a2e;
    color: #fff;
}

/* Form Row (side by side) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Input with prefix */
.input-prefix {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.input-prefix span {
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #82c7a5;
    font-weight: 600;
}

.input-prefix input {
    border: none;
    border-radius: 0;
    background: transparent;
}

.input-prefix:focus-within {
    border-color: #82c7a5;
}

.help-text {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #888;
}

.optional-label {
    font-weight: 400;
    font-size: 0.85rem;
    color: #888;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #82c7a5 0%, #5fa882 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(130, 199, 165, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success Message */
.success-message {
    background: rgba(130, 199, 165, 0.1);
    border: 1px solid #82c7a5;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #82c7a5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 20px;
}

.success-message h2 {
    color: #82c7a5;
    margin-bottom: 20px;
}

.success-message p {
    margin-bottom: 10px;
    color: #e0e0e0;
}

.success-message strong {
    color: #82c7a5;
    font-size: 1.2rem;
}

.download-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, #82c7a5 0%, #5fa882 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(130, 199, 165, 0.4);
}

.remaining-note {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #888;
}

/* Error Message */
.error-message {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid #ff6464;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
}

.error-icon {
    width: 60px;
    height: 60px;
    background: #ff6464;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 20px;
    font-weight: bold;
}

.error-message h2 {
    color: #ff6464;
    margin-bottom: 15px;
}

.retry-btn {
    padding: 14px 40px;
    background: #ff6464;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

/* Limit Message */
.limit-message {
    background: rgba(255, 180, 50, 0.1);
    border: 1px solid #ffb432;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
}

.limit-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.limit-message h2 {
    color: #ffb432;
    margin-bottom: 15px;
}

.contact-link {
    display: inline-block;
    padding: 14px 30px;
    background: linear-gradient(135deg, #ffb432 0%, #e69b00 100%);
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.contact-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 180, 50, 0.4);
}

/* Disclaimer */
.disclaimer {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid #ffb432;
}

.disclaimer p {
    font-size: 0.85rem;
    color: #888;
}

.disclaimer strong {
    color: #ffb432;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    font-size: 0.9rem;
    color: #666;
}

.footer a {
    color: #82c7a5;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Hide elements */
.hidden {
    display: none !important;
}

/* Disabled form groups (mutual exclusion) */
.form-group.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.form-group.disabled input {
    background: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
}

.form-group.disabled .input-prefix {
    background: rgba(255, 255, 255, 0.03);
}

.form-group.disabled label {
    color: #666;
}
