.hma-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 420px;
    margin: 20px auto;
    padding: 0 16px;
}

.hma-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
}

.hma-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 4px;
}

.hma-desc {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin: 0 0 28px;
}

.hma-field {
    position: relative;
    margin-bottom: 24px;
    width: 100%;
}

.hma-field__label {
    position: absolute;
    top: 0;
    right: 14px;
    transform: translateY(-50%);
    background: #fff;
    padding: 0 6px;
    line-height: 1;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.hma-field:focus-within .hma-field__label {
    color: #00754a;
}

.hma-input {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hma-input:focus {
    outline: none;
    border-color: #00754a;
    box-shadow: 0 0 0 1px #00754a;
    background: #f6fcf9;
}

.hma-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.hma-field--phone .hma-input {
    direction: ltr;
    text-align: left;
    padding-left: 48px;
}

.hma-phone-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    z-index: 2;
    direction: ltr;
    white-space: nowrap;
    background: #fff;
    padding: 0 4px;
    pointer-events: none;
}

.hma-otp-input {
    text-align: center;
    font-size: 28px;
    letter-spacing: 4px;
    direction: ltr;
    font-weight: 700;
    max-width: 160px;
    margin: 0 auto;
}

.hma-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hma-btn-primary {
    background: #00754a;
    color: #fff;
}

.hma-btn-primary:hover {
    background: #00633d;
    box-shadow: 0 2px 8px rgba(0,117,74,0.3);
}

.hma-btn-text {
    background: none;
    border: none;
    color: #00754a;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 12px;
    font-weight: 600;
}

.hma-btn-text:hover {
    text-decoration: underline;
}

.hma-link {
    text-align: center;
    margin-top: 16px;
}

.hma-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    border-bottom: 2px solid #e9ecef;
}

.hma-tab {
    flex: 1;
    padding: 12px 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.hma-tab-active {
    color: #00754a;
    border-bottom-color: #00754a;
}

.hma-tab:hover {
    color: #00754a;
}

.hma-tab-content {
    display: block;
}

.hma-timer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #9ca3af;
}

.hma-error {
    display: none;
    color: #dc2626;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 6px;
}

.hma-success-box {
    text-align: center;
    padding: 32px 16px 16px;
}

.hma-success-icon {
    width: 56px;
    height: 56px;
    background: #00754a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 12px;
}

.hma-success-msg {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.hma-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.hma-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e9ecef;
    border-top-color: #00754a;
    border-radius: 50%;
    animation: hma-spin 0.8s linear infinite;
}

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

.hma-info {
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.hma-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
}

.hma-info-item:last-child {
    margin-bottom: 0;
}

.hma-info-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.hma-info-value {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 600;
}

.hma-info-value--public {
    color: #00754a;
    font-family: monospace;
    letter-spacing: 1px;
    direction: ltr;
    text-align: center;
    background: #e8f5f0;
    padding: 8px;
    border-radius: 6px;
}

.hma-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.hma-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px;
}

.hma-back-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    margin-bottom: -8px;
    display: inline-block;
}

.hma-back-btn:hover {
    color: #333;
}

.hma-loggedin {
    text-align: center;
    padding: 24px 16px;
}

.hma-loggedin p {
    font-size: 15px;
    color: #333;
    margin: 0 0 16px;
}

.hma-loggedin a {
    color: #00754a;
    font-weight: 600;
    text-decoration: none;
}

.hma-loggedin a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .hma-wrapper { padding: 0 8px; }
    .hma-card { padding: 24px 16px; }
    .hma-title { font-size: 20px; }
    .hma-input { padding: 12px; font-size: 13px; }
    .hma-phone-icon { left: 12px; }
    .hma-tab { font-size: 13px; padding: 10px 8px; }
}