/* EFM License Manager Portal - v4.0 Clean */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

* { box-sizing: border-box; }

/* Auth Wrapper */
.efmlm-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.efmlm-auth-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.efmlm-auth-logo {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

.efmlm-auth-box h1 {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 8px;
}

.efmlm-auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin: 0 0 32px;
    font-size: 15px;
}

/* Form Fields */
.efmlm-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-field input {
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    color: var(--gray-800);
    transition: all 0.2s;
    background: #fff;
    width: 100%;
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-field input::placeholder {
    color: var(--gray-400);
}

/* Input with Icon */
.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon svg {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
}

.input-icon input {
    padding-left: 44px;
}

/* Password Toggle */
.input-password input {
    padding-right: 48px;
}

.toggle-pw {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    transition: background 0.2s;
}

.toggle-pw:hover {
    background: var(--gray-100);
}

.toggle-pw svg {
    position: static;
    width: 20px;
    height: 20px;
    color: var(--gray-500);
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.password-strength .strength-bar {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength .strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-strength .strength-text {
    font-size: 12px;
    font-weight: 500;
    min-width: 70px;
}

/* Submit Button */
.btn-submit {
    height: 52px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.btn-submit:hover {
    background: var(--primary-hover);
}

.btn-submit:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-submit.loading .btn-text {
    visibility: hidden;
}

.btn-submit .btn-loader {
    display: none;
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-loader {
    display: block;
}

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

/* Messages */
.form-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
    text-align: center;
}

.form-message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.form-message.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Auth Footer */
.efmlm-auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 14px;
}

.efmlm-auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

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

/* OTP Section */
.otp-header {
    text-align: center;
    margin-bottom: 24px;
}

.otp-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.otp-header h2 {
    font-size: 22px;
    margin: 0 0 8px;
    color: var(--gray-900);
}

.otp-header p {
    color: var(--gray-500);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.otp-header strong {
    color: var(--gray-800);
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.otp-box {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    transition: all 0.2s;
}

.otp-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.otp-timer {
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.otp-timer span {
    font-weight: 600;
    color: var(--primary);
}

.otp-actions {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--gray-500);
}

.otp-actions button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}

.otp-actions button:disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}

.btn-back {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 16px;
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 14px;
    cursor: pointer;
}

.btn-back:hover {
    color: var(--primary);
}

/* Checkout Styles */
.efmlm-checkout-wrapper {
    min-height: 100vh;
    padding: 40px 20px;
    background: var(--gray-50);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.efmlm-checkout-container {
    max-width: 680px;
    margin: 0 auto;
}

.efmlm-checkout-header {
    text-align: center;
    margin-bottom: 32px;
}

.efmlm-checkout-header h1 {
    font-size: 28px;
    color: var(--gray-900);
    margin: 0 0 8px;
}

.efmlm-checkout-header p {
    color: var(--gray-500);
    margin: 0;
}

/* Progress Steps */
.efmlm-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.progress-step span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.progress-step.active span {
    background: var(--primary);
    color: #fff;
}

.progress-step.done span {
    background: var(--success);
    color: #fff;
}

.progress-step label {
    font-size: 12px;
    color: var(--gray-500);
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
}

/* Checkout Cards */
.efmlm-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.efmlm-card h3 {
    font-size: 18px;
    color: var(--gray-900);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-num {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Package Grid */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.package-card {
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.package-card:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}

.package-card.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.package-card .pkg-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.package-card .pkg-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.package-card .pkg-meta {
    font-size: 12px;
    color: var(--gray-500);
}

/* Selection Summary */
.selection-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.summary-left strong {
    display: block;
    font-size: 16px;
}

.summary-left span {
    font-size: 13px;
    opacity: 0.9;
}

.sum-total {
    font-size: 28px;
    font-weight: 700;
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    height: 48px;
    padding: 0 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-outline {
    background: #fff;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
}

/* Step Message */
.step-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 16px;
    display: none;
}

.step-message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
}

.step-message.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
}

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: block;
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-option-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    transition: all 0.2s;
}

.payment-option:hover .payment-option-content {
    border-color: var(--gray-300);
}

.payment-option.selected .payment-option-content {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}

.pay-icon {
    font-size: 28px;
}

.pay-info {
    flex: 1;
}

.pay-info strong {
    display: block;
    color: var(--gray-800);
}

.pay-info small {
    color: var(--gray-500);
    font-size: 13px;
}

.pay-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    position: relative;
}

.payment-option.selected .pay-check {
    background: var(--primary);
    border-color: var(--primary);
}

.payment-option.selected .pay-check::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 500px) {
    .efmlm-auth-box {
        padding: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .otp-box {
        width: 44px;
        height: 50px;
        font-size: 20px;
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .selection-summary {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}
