/* ======================================
   ECP Auth — Stylesheet
   ====================================== */

:root {
    --ecp-primary: #2563eb;
    --ecp-primary-hover: #1d4ed8;
    --ecp-primary-light: #dbeafe;
    --ecp-danger: #dc2626;
    --ecp-danger-light: #fef2f2;
    --ecp-success: #16a34a;
    --ecp-success-light: #f0fdf4;
    --ecp-warning: #d97706;
    --ecp-warning-light: #fffbeb;
    --ecp-text: #1e293b;
    --ecp-text-secondary: #64748b;
    --ecp-bg: #f8fafc;
    --ecp-card-bg: #ffffff;
    --ecp-border: #e2e8f0;
    --ecp-radius: 12px;
    --ecp-radius-sm: 8px;
    --ecp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ecp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --ecp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ecp-transition: all 0.2s ease;
}

/* --- Layout --- */

.ecp-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: var(--ecp-font);
}

.ecp-card {
    width: 100%;
    max-width: 480px;
    background: var(--ecp-card-bg);
    border-radius: var(--ecp-radius);
    box-shadow: var(--ecp-shadow-lg);
    overflow: hidden;
}

.ecp-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--ecp-primary) 0%, #7c3aed 100%);
    color: white;
}

.ecp-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ecp-icon {
    font-size: 1.5rem;
}

.ecp-subtitle {
    font-size: 0.875rem;
    opacity: 0.85;
    margin: 0;
}

.ecp-content {
    padding: 1.5rem 2rem;
}

.ecp-footer {
    padding: 1rem 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--ecp-border);
}

/* --- Forms --- */

.ecp-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ecp-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ecp-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ecp-text);
}

.ecp-form .form-control,
.ecp-form input[type="text"],
.ecp-form input[type="email"],
.ecp-form input[type="password"],
.ecp-form input[type="file"] {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--ecp-border);
    border-radius: var(--ecp-radius-sm);
    font-size: 0.9375rem;
    font-family: var(--ecp-font);
    color: var(--ecp-text);
    background: var(--ecp-card-bg);
    transition: var(--ecp-transition);
    box-sizing: border-box;
}

.ecp-form .form-control:focus,
.ecp-form input:focus {
    outline: none;
    border-color: var(--ecp-primary);
    box-shadow: 0 0 0 3px var(--ecp-primary-light);
}

.ecp-help-text {
    font-size: 0.75rem;
    color: var(--ecp-text-secondary);
    margin: 0;
}

.ecp-field-error {
    font-size: 0.8125rem;
    color: var(--ecp-danger);
    font-weight: 500;
}

/* --- Buttons --- */

.ecp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--ecp-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--ecp-font);
    cursor: pointer;
    transition: var(--ecp-transition);
}

.ecp-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--ecp-primary) 0%, #7c3aed 100%);
    color: white;
}

.ecp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.ecp-btn-primary:active {
    transform: translateY(0);
}

/* --- Alerts --- */

.ecp-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: var(--ecp-radius-sm);
    font-size: 0.875rem;
    margin: 0 2rem;
}

.ecp-alert-error {
    background: var(--ecp-danger-light);
    color: var(--ecp-danger);
    border: 1px solid #fecaca;
}

.ecp-alert-success {
    background: var(--ecp-success-light);
    color: var(--ecp-success);
    border: 1px solid #bbf7d0;
}

.ecp-alert-warning {
    background: var(--ecp-warning-light);
    color: var(--ecp-warning);
    border: 1px solid #fde68a;
}

.ecp-alert-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

/* --- Challenge Section --- */

.ecp-challenge-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ecp-cert-details {
    background: var(--ecp-primary-light);
    border-radius: var(--ecp-radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.ecp-cert-details h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ecp-primary);
    margin: 0 0 0.5rem;
}

.ecp-cert-details p {
    font-size: 0.8125rem;
    color: var(--ecp-text);
    margin: 0.25rem 0;
}

.ecp-challenge-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
}

.ecp-challenge-status p {
    font-size: 0.875rem;
    color: var(--ecp-text-secondary);
    margin: 0;
}

/* --- Spinner --- */

.ecp-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2.5px solid var(--ecp-border);
    border-top-color: var(--ecp-primary);
    border-radius: 50%;
    animation: ecp-spin 0.8s linear infinite;
}

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

/* --- Links --- */

.ecp-link {
    color: var(--ecp-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--ecp-transition);
}

.ecp-link:hover {
    color: var(--ecp-primary-hover);
    text-decoration: underline;
}

.ecp-footer-text {
    font-size: 0.875rem;
    color: var(--ecp-text-secondary);
    margin: 0;
}

/* --- Responsive --- */

@media (max-width: 540px) {
    .ecp-container {
        padding: 1rem;
    }

    .ecp-card {
        max-width: 100%;
    }

    .ecp-header,
    .ecp-content,
    .ecp-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .ecp-alert {
        margin-left: 1.25rem;
        margin-right: 1.25rem;
    }
}
