/**
 * Authentication Pages CSS
 * Namespace: dm-auth-*
 * Isolated styles for login, register, and account pages
 */

/* Container */
.dm-auth-container {
    /*min-height: 72vh;*/
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /*background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);*/
}

body > .dm-auth-container {
    min-height: calc(100vh - 242px);
}

/* Card */
.dm-auth-card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    width: 100%;
    max-width: 28rem;
}

.dm-auth-card-wide {
    max-width: 48rem;
}

/* Wide layout for cart with sidebar */
.dm-auth-card-wide.dm-cart-layout-wide {
    max-width: 70rem;
    background: transparent;
    border: 0;
}

/* Header */
.dm-auth-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.dm-auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

/* Messages */
.dm-auth-error {
    background-color: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.dm-auth-success {
    background-color: #c6f6d5;
    border: 1px solid #68d391;
    color: #22543d;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Form */
.dm-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dm-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dm-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.dm-auth-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
}

.dm-auth-input {
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    width: 100%;
}

[dir="rtl"] .dm-auth-input {
    text-align: right;
}

.dm-auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dm-auth-input:disabled {
    background-color: #f7fafc;
    cursor: not-allowed;
}

.dm-auth-hint {
    font-size: 0.75rem;
    color: #718096;
    margin: 0;
}

/* Buttons */
.dm-auth-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    width: 100%;
}

.dm-auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dm-auth-btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.dm-auth-btn-primary:hover:not(:disabled) {
    background-color: var(--primary-color-hover);
}

.dm-auth-btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.dm-auth-btn-secondary:hover:not(:disabled) {
    background-color:  var(--secondary-color);
}

.dm-auth-spinner-icon {
    width: 1rem;
    height: 1rem;
    animation: dm-auth-spin 1s linear infinite;
}

@keyframes dm-auth-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.dm-cart-empty .dm-auth-btn {
    margin-top: 12px;
}

/* Footer */
.dm-auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.dm-auth-footer-text {
    font-size: 0.875rem;
    color: #4a5568;
    margin: 0;
}

.dm-auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.dm-auth-link:hover {
    text-decoration: underline;
}

/* Account page sections */
.dm-auth-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.dm-auth-section:last-child {
    border-bottom: none;
}

.dm-auth-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 1rem 0;
}

/* Quick links */
.dm-auth-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.dm-auth-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    justify-content: center;
}

.dm-auth-link-btn:hover {
    border-color: var(--primary-color);
    background-color: #f7fafc;
}

.dm-auth-link-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.dm-auth-link-btn-danger {
    color: #e53e3e;
}

.dm-auth-link-btn-danger:hover {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

/* Responsive */
@media (max-width: 640px) {
    .dm-auth-card {
        padding: 1.5rem;
    }

    .dm-auth-title {
        font-size: 1.5rem;
    }

    .dm-auth-row {
        grid-template-columns: 1fr;
    }

    .dm-auth-links {
        grid-template-columns: 1fr;
    }
}
