/**
 * Datum Platform Authentication Styles
 */

/* Modal */
.datum-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.datum-modal.active {
    display: flex;
}

.datum-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.datum-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.3s ease;
}

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

.datum-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.datum-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Modal Header */
.datum-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.datum-modal-logo {
    height: 32px;
    margin-bottom: 16px;
}

.datum-modal-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 24px;
    color: #1e293b;
    margin: 0 0 8px;
}

.datum-modal-header p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Success/Premium Icons */
.datum-success-icon,
.datum-premium-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.datum-success-icon {
    background: #d1fae5;
    color: #059669;
}

.datum-premium-icon {
    background: linear-gradient(135deg, #f5f0fa, #e6d4f4);
    color: #51087e;
}

/* Forms */
.datum-form-group {
    margin-bottom: 20px;
}

.datum-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.datum-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.2s;
    box-sizing: border-box;
}

.datum-form-group input:focus {
    outline: none;
    border-color: #51087e;
    box-shadow: 0 0 0 3px rgba(81, 8, 126, 0.1);
}

.datum-form-group input::placeholder {
    color: #94a3b8;
}

.datum-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.datum-form-row a {
    color: #51087e;
    text-decoration: none;
}

.datum-form-row a:hover {
    text-decoration: underline;
}

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

/* Checkbox */
.datum-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #64748b;
}

.datum-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Error/Success Messages */
.datum-form-error,
.datum-form-success {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}

.datum-form-error:not(:empty),
.datum-form-success:not(:empty) {
    display: block;
}

.datum-form-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.datum-form-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Form Footer */
.datum-form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
    color: #64748b;
}

.datum-form-footer a {
    color: #51087e;
    text-decoration: none;
    font-weight: 500;
}

.datum-form-footer a:hover {
    text-decoration: underline;
}

/* Buttons */
.datum-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

/* Google Button */
.datum-btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.datum-btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Divider */
.datum-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 13px;
}

.datum-divider::before,
.datum-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.datum-divider span {
    padding: 0 16px;
}

.datum-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #51087e, #700bae);
    color: white;
}

.datum-btn-primary:hover {
    background: linear-gradient(135deg, #700bae, #8f0ede);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(81, 8, 126, 0.4);
}

.datum-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.datum-btn-secondary {
    width: 100%;
    background: #f1f5f9;
    color: #475569;
    margin-top: 12px;
}

.datum-btn-secondary:hover {
    background: #e2e8f0;
}

.datum-btn-outline {
    background: white;
    border: 2px solid #51087e;
    color: #51087e;
    padding: 10px 20px;
    white-space: nowrap;
}

.datum-btn-outline:hover {
    background: #faf8fc;
    border-color: #700bae;
    color: #700bae;
}

/* Tier Comparison */
.datum-tier-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.datum-tier {
    text-align: center;
}

.datum-tier .tier-name {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.datum-tier .tier-label {
    font-size: 16px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
}

.datum-tier.current .tier-label {
    background: #e2e8f0;
    color: #475569;
}

.datum-tier.required .tier-label {
    background: linear-gradient(135deg, #f5f0fa, #e6d4f4);
    color: #51087e;
}

.datum-tier-arrow {
    font-size: 24px;
    color: #cbd5e1;
}

/* Header Auth Nav */
.datum-auth-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

.datum-user-menu {
    position: relative;
}

.datum-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.datum-user-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.datum-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #51087e, #700bae);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.datum-user-name {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

.datum-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.datum-user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.datum-user-info {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.datum-user-info strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
}

.datum-user-info span {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.datum-tier-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.datum-tier-badge.free {
    background: #f1f5f9;
    color: #64748b;
}

.datum-tier-badge.free_login {
    background: #f5f0fa;
    color: #51087e;
}

.datum-tier-badge.premium {
    background: linear-gradient(135deg, #f5f0fa, #e6d4f4);
    color: #51087e;
}

.datum-user-dropdown a {
    display: block;
    padding: 12px 16px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
}

.datum-user-dropdown a:hover {
    background: #f8fafc;
    color: #1e293b;
}

.datum-user-dropdown hr {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 0;
}

/* Subscribe Button */
.datum-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.datum-subscribe-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.datum-subscribe-btn.subscribed {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #059669;
}

.datum-subscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.datum-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Notifications */
.datum-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    z-index: 10001;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    max-width: 400px;
}

.datum-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.datum-notification button {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
}

.datum-notification-success {
    border-left: 4px solid #10b981;
}

.datum-notification-error {
    border-left: 4px solid #ef4444;
}

.datum-notification-info {
    border-left: 4px solid #51087e;
}

/* Access Gate Overlay */
.datum-access-gate {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.95) 30%, white 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    z-index: 10;
}

.datum-access-gate h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
    color: #1e293b;
    margin: 0 0 8px;
}

.datum-access-gate p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px;
    max-width: 300px;
}

/* Responsive */
@media (max-width: 768px) {
    .datum-modal-content {
        margin: 16px;
        padding: 28px;
        max-width: calc(100% - 32px);
    }

    .datum-form-row-2 {
        grid-template-columns: 1fr;
    }

    .datum-auth-nav {
        margin-left: 8px;
    }

    .datum-auth-nav .datum-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .datum-notification {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}
