/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Logo styles */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section.centered {
    margin-bottom: 50px;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3d2463 0%, #5a3a7d 100%);
    margin: 0 auto 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(61, 36, 99, 0.3);
    position: relative;
    overflow: hidden;
}

.logo.large {
    width: 100px;
    height: 100px;
}

.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
}

.logo-text {
    font-size: 36px;
    font-weight: 900;
    color: white;
    letter-spacing: -2px;
    font-family: 'Arial Black', sans-serif;
}

.logo.large .logo-text {
    font-size: 45px;
}

/* Main title */
.main-title {
    font-size: 2.5em;
    color: #3d2463;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

/* Form container */
.form-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-title {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Tool selection info */
.tool-selection-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #3d2463;
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 5px;
}

.tool-selection-info label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.selected-tool {
    font-size: 1.1em;
    color: #3d2463;
    font-weight: 700;
    padding: 8px 0;
}

/* Form groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.required {
    color: #e74c3c;
}

/* Name fields */
.name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.field-wrapper {
    display: flex;
    flex-direction: column;
}

.field-wrapper small {
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

/* Input fields */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #3d2463;
    box-shadow: 0 0 0 3px rgba(61, 36, 99, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.hint {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.85em;
}

/* Buttons */
.button-group {
    margin-top: 30px;
}

.btn-submit {
    background: linear-gradient(135deg, #3d2463 0%, #5a3a7d 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(61, 36, 99, 0.3);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 36, 99, 0.4);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled,
.btn-submit.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #999;
}

/* Email validation status */
.email-status {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    font-weight: 600;
    min-height: 18px;
}

.email-status.valid {
    color: #4CAF50;
}

.email-status.invalid {
    color: #e74c3c;
}

/* Messages */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
    animation: slideIn 0.3s ease;
}

.message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9em;
}

.footer.centered {
    margin-top: 60px;
}

.footer p {
    margin-bottom: 8px;
}

.footer .links a,
.footer .support a {
    color: #3d2463;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer .links a:hover,
.footer .support a:hover {
    color: #5a3a7d;
    text-decoration: underline;
}

/* Tools grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.tool-card {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3d2463;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.tool-header h2 {
    color: #3d2463;
    font-size: 1.5em;
    font-weight: 700;
}

.version-badge {
    background: linear-gradient(135deg, #3d2463 0%, #5a3a7d 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
}

.tool-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    min-height: 60px;
}

.tool-footer {
    margin-top: 20px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3d2463 0%, #5a3a7d 100%);
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(61, 36, 99, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 36, 99, 0.4);
}

.btn-download .icon {
    font-size: 1.2em;
}

/* Responsive design */
@media (max-width: 768px) {
    .name-fields {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 25px;
    }
    
    .main-title {
        font-size: 2em;
    }
}

/* Loading state */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Thank You Popup */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

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

.popup-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s ease 0.2s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.popup-content h2 {
    color: #3d2463;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 700;
}

.popup-content p {
    color: #555;
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.popup-main {
    font-size: 1.1em !important;
    margin-bottom: 10px !important;
}

.popup-highlight {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3d2463;
    margin: 20px 0 !important;
    font-weight: 600 !important;
    color: #3d2463 !important;
}

.popup-note {
    font-size: 0.9em !important;
    color: #666 !important;
    font-style: italic;
    margin-top: 10px !important;
}

.popup-close {
    background: linear-gradient(135deg, #3d2463 0%, #5a3a7d 100%);
    color: white;
    border: none;
    padding: 14px 50px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(61, 36, 99, 0.3);
}

.popup-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 36, 99, 0.4);
}

.popup-close:active {
    transform: translateY(0);
}

/* Email validation status */
.email-status {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    font-weight: 600;
}

.email-status.valid {
    color: #4CAF50;
}

.email-status.invalid {
    color: #e74c3c;
}

/* Disabled submit button */
.btn-submit.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit.disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(61, 36, 99, 0.3);
}

/* Thank You Popup */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

.popup-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 48px;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.popup-content h2 {
    color: #3d2463;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 700;
}

.popup-content p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.popup-content p strong {
    color: #3d2463;
    font-weight: 600;
}

.popup-note {
    font-size: 0.95em;
    color: #999;
    font-style: italic;
    margin-top: 20px;
}

.popup-close {
    background: linear-gradient(135deg, #3d2463 0%, #5a3a7d 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(61, 36, 99, 0.3);
}

.popup-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 36, 99, 0.4);
}

.popup-close:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive popup */
@media (max-width: 768px) {
    .popup-content {
        padding: 30px 20px;
    }
    
    .popup-content h2 {
        font-size: 1.6em;
    }
    
    .popup-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
}
