/* Derivo Secure Login Styles */

:root {
    --primary-dark: #0F172A;
    --primary-green: #05af2d;
    --primary-accent: #05af2d;
    --secondary-green: #05af2d;
    --accent-green: #05af2d;
    --light-bg: #F8FAFC;
    --white: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --error-color: #EF4444;
    --success-color: #10B981;
    --gradient-1: linear-gradient(135deg, #05af2d 0%, #05af2d 100%);
    --gradient-2: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

* {
    box-sizing: border-box;
}

.derivo-login-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-2);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.derivo-login-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="%2305af2d" fill-opacity="0.1"/></svg>') repeat;
    opacity: 0.3;
    pointer-events: none;
}

.derivo-login-container {
    background: var(--white);
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

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

.derivo-login-header {
    text-align: center;
    margin-bottom: 40px;
}

.derivo-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-weight: 800;
    font-size: 24px;
    color: var(--primary-dark);
}

.derivo-logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.derivo-login-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.derivo-login-header p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.derivo-login-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.derivo-login-alert.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.derivo-alert-icon {
    flex-shrink: 0;
    color: var(--error-color);
}

.derivo-login-alert.success .derivo-alert-icon {
    color: var(--success-color);
}

.derivo-alert-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.derivo-login-form {
    margin-bottom: 24px;
}

.derivo-form-group {
    margin-bottom: 24px;
}

.derivo-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.derivo-form-group label svg {
    width: 16px;
    height: 16px;
    color: var(--primary-green);
}

.derivo-form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--text-primary);
}

.derivo-form-group input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(5, 175, 45, 0.1);
}

.derivo-form-group input::placeholder {
    color: var(--text-secondary);
}

.derivo-password-wrapper {
    position: relative;
}

.derivo-password-wrapper input {
    padding-right: 50px;
}

.derivo-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.derivo-password-toggle:hover {
    color: var(--primary-green);
}

.derivo-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.derivo-forgot-password {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-green);
    text-decoration: none;
    transition: all 0.3s ease;
}

.derivo-forgot-password:hover {
    color: var(--accent-green);
    gap: 8px;
}

.derivo-login-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: var(--gradient-1);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.derivo-login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(5, 175, 45, 0.35);
}

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

.derivo-spinner {
    animation: rotate 1s linear infinite;
}

.derivo-spinner .path {
    stroke: var(--white);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.derivo-login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.derivo-login-footer p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.derivo-login-footer a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.derivo-login-footer a:hover {
    color: var(--accent-green);
}

/* Success Modal */
.derivo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

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

.derivo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

.derivo-modal-content {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 400px;
    text-align: center;
    animation: modalSlideUp 0.4s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.derivo-success-animation {
    margin-bottom: 30px;
}

.derivo-checkmark {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    position: relative;
}

.derivo-checkmark-circle {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.derivo-checkmark-circle-path {
    stroke: var(--primary-green);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes strokeCircle {
    100% {
        stroke-dashoffset: 0;
    }
}

.derivo-checkmark-check {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.derivo-checkmark-check-path {
    stroke: var(--primary-green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeCheck {
    100% {
        stroke-dashoffset: 0;
    }
}

.derivo-modal-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.derivo-modal-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* No Purchase Modal Styles */
.derivo-no-purchase-content {
    max-width: 420px;
}

.derivo-no-purchase-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    color: var(--error-color);
    animation: pulseWarning 2s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
}

.derivo-no-purchase-content h2 {
    color: var(--error-color);
    font-size: 24px;
    margin-bottom: 16px;
}

.derivo-no-purchase-content p {
    margin-bottom: 28px;
    line-height: 1.6;
}

.derivo-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: var(--gradient-1);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-decoration: none;
}

.derivo-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(5, 175, 45, 0.35);
    color: var(--white);
}

.derivo-modal-btn svg {
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 576px) {
    .derivo-login-container {
        padding: 40px 30px;
    }
    
    .derivo-login-header h1 {
        font-size: 26px;
    }
    
    .derivo-modal-content {
        padding: 40px 30px;
        margin: 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .derivo-login-container {
        background: #1E293B;
    }
    
    .derivo-login-header h1 {
        color: var(--white);
    }
    
    .derivo-form-group label {
        color: var(--white);
    }
    
    .derivo-form-group input {
        background: #0F172A;
        color: var(--white);
        border-color: #334155;
    }
    
    .derivo-login-footer {
        border-top-color: #334155;
    }
    
    .derivo-modal-content {
        background: #1E293B;
    }
    
    .derivo-modal-content h2 {
        color: var(--white);
    }

    .derivo-no-purchase-content h2 {
        color: var(--error-color);
    }

    .derivo-no-purchase-icon {
        background: rgba(239, 68, 68, 0.2);
    }
}
