/* Chipa Auth UI Styles v1.0.0 */

/* Modal overlay */
.chipa-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chipa-auth-modal.active {
    opacity: 1;
}

.chipa-auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.chipa-auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    margin: 20px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chipa-auth-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

/* Close button */
.chipa-auth-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.chipa-auth-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #334155;
    transform: rotate(90deg);
}

/* Header */
.chipa-auth-header {
    text-align: center;
    padding: 48px 40px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chipa-auth-logo {
    margin: 0 auto 20px;
    width: 64px;
    height: 64px;
    animation: logoFloat 3s ease-in-out infinite;
}

.chipa-auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.chipa-auth-header p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* Content */
.chipa-auth-content {
    padding: 40px;
}

/* Form */
.chipa-auth-form {
    margin-bottom: 24px;
}

.chipa-form-group {
    margin-bottom: 24px;
    position: relative;
}

.chipa-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.chipa-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.chipa-input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 44px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.2s ease;
    font-family: inherit;
}

.chipa-input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.chipa-input-wrapper input::placeholder {
    color: #94a3b8;
}

.chipa-input-icon {
    position: absolute;
    right: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.chipa-password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.chipa-password-toggle:hover {
    color: #334155;
}

/* Error states */
.chipa-form-group.error .chipa-input-wrapper input {
    border-color: #ef4444;
    background: #fef2f2;
}

.chipa-form-group.error .chipa-input-wrapper input:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.chipa-error-message {
    display: none;
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

.chipa-form-group.error .chipa-error-message {
    display: block;
    animation: slideDown 0.2s ease;
}

.chipa-general-error {
    display: none;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

/* Form options */
.chipa-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.chipa-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.chipa-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.chipa-checkbox-mark {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chipa-checkbox input:checked + .chipa-checkbox-mark {
    background: #667eea;
    border-color: #667eea;
}

.chipa-checkbox input:checked + .chipa-checkbox-mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.chipa-checkbox span:last-child {
    font-size: 14px;
    color: #475569;
}

.chipa-link {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.chipa-link:hover {
    color: #5568d3;
}

/* Buttons */
.chipa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.chipa-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.chipa-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.chipa-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.chipa-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.chipa-btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.chipa-btn-primary.loading .chipa-btn-text {
    opacity: 0;
}

.chipa-btn-primary.loading .chipa-btn-loader {
    display: block;
    position: absolute;
}

/* Social buttons */
.chipa-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 28px 0;
    color: #94a3b8;
    font-size: 14px;
}

.chipa-divider::before,
.chipa-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.chipa-divider span {
    padding: 0 16px;
}

.chipa-social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.chipa-btn-social {
    background: white;
    border: 2px solid #e2e8f0;
    color: #475569;
    padding: 12px 16px;
}

.chipa-btn-social:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* Success state */
.chipa-auth-success {
    padding: 60px 40px 40px;
    text-align: center;
}

.chipa-success-animation {
    margin-bottom: 24px;
}

.chipa-checkmark {
    display: inline-block;
}

.chipa-checkmark-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
}

.chipa-checkmark-check {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
}

.chipa-checkmark.animate .chipa-checkmark-circle {
    animation: drawCircle 0.6s ease forwards;
}

.chipa-checkmark.animate .chipa-checkmark-check {
    animation: drawCheck 0.4s ease 0.4s forwards;
}

.chipa-auth-success h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.chipa-user-email {
    color: #64748b;
    font-size: 15px;
    margin: 0 0 24px;
}

/* License card */
.chipa-license-info {
    margin-top: 24px;
}

.chipa-license-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #e2e8f0;
}

.chipa-license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chipa-license-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chipa-license-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.chipa-license-status.status-active {
    background: #dcfce7;
    color: #15803d;
}

.chipa-license-status.status-trial {
    background: #fef3c7;
    color: #a16207;
}

.chipa-license-status.status-expired {
    background: #fee2e2;
    color: #b91c1c;
}

.chipa-license-key {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
}

.chipa-license-code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #334155;
    font-weight: 600;
    word-break: break-all;
}

.chipa-copy-btn {
    background: #667eea;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chipa-copy-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.chipa-copy-btn.copied {
    background: #10b981;
}

/* Footer */
.chipa-auth-footer {
    padding: 24px 40px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
    color: #64748b;
}

.chipa-auth-footer p {
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

/* Responsive */
@media (max-width: 640px) {
    .chipa-auth-container {
        margin: 10px;
    }
    
    .chipa-auth-header {
        padding: 40px 24px 24px;
    }
    
    .chipa-auth-content {
        padding: 28px 24px;
    }
    
    .chipa-auth-success {
        padding: 48px 24px 32px;
    }
    
    .chipa-auth-footer {
        padding: 20px 24px;
    }
    
    .chipa-social-buttons {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chipa-auth-card {
        background: #1e293b;
        color: #e2e8f0;
    }
    
    .chipa-form-group label {
        color: #e2e8f0;
    }
    
    .chipa-input-wrapper input {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .chipa-input-wrapper input:focus {
        background: #1e293b;
        border-color: #667eea;
    }
    
    .chipa-btn-social {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .chipa-btn-social:hover {
        background: #1e293b;
    }
    
    .chipa-auth-footer {
        background: #0f172a;
        border-top-color: #334155;
    }
    
    .chipa-license-card {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        border-color: #334155;
    }
    
    .chipa-license-key {
        background: #1e293b;
        border-color: #475569;
    }
    
    .chipa-license-code {
        color: #e2e8f0;
    }
}
